CSS Basics Quiz
25 Questions
100 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does CSS stand for?

Cascading Style Sheets

What is the correct HTML for referring to an external style sheet?

Where in an HTML document is the correct place to refer to an external style sheet?

In the section

Which HTML tag is used to define an internal style sheet?

Signup and view all the answers

Which HTML attribute is used to define inline styles?

<p>style</p> Signup and view all the answers

Which is the correct CSS syntax?

<p>body {color: black;}</p> Signup and view all the answers

How do you insert a comment in a CSS file?

Signup and view all the answers

Which property is used to change the background color?

<p>background-color</p> Signup and view all the answers

How do you add a background color for all

elements?

<p>h1 {background-color:#FFFFFF;}</p> Signup and view all the answers

Which CSS property is used to change the text color of an element?

<p>color</p> Signup and view all the answers

Which CSS property controls the text size?

<p>font-size</p> Signup and view all the answers

What is the correct CSS syntax for making all

elements bold?

<p>p {font-weight:bold;}</p> Signup and view all the answers

How do you display hyperlinks without an underline?

<p>a {text-decoration:none;}</p> Signup and view all the answers

How do you make each word in a text start with a capital letter?

<p>text-transform:capitalize</p> Signup and view all the answers

Which property is used to change the font of an element?

<p>Both font-family and font can be used</p> Signup and view all the answers

How do you make the text bold?

<p>font-weight:bold;</p> Signup and view all the answers

How do you display a border like this: The top border = 10 pixels, The bottom border = 5 pixels, The left border = 20 pixels, The right border = 1 pixel?

<p>border-width:10px 1px 5px 20px;</p> Signup and view all the answers

Which property is used to change the left margin of an element?

<p>margin-left</p> Signup and view all the answers

When using the padding property, are you allowed to use negative values?

<p>False</p> Signup and view all the answers

How do you make a list that lists its items with squares?

<p>list-style-type: square;</p> Signup and view all the answers

How do you select an element with id 'demo'?

<p>#demo</p> Signup and view all the answers

How do you select elements with class name 'test'?

<p>.test</p> Signup and view all the answers

How do you select all

elements inside a

element?

<p>div p</p> Signup and view all the answers

How do you group selectors?

<p>Separate each selector with a comma</p> Signup and view all the answers

What is the default value of the position property?

<p>static</p> Signup and view all the answers

Study Notes

CSS Basics

  • CSS stands for Cascading Style Sheets.
  • Correct HTML for an external style sheet: <link rel="stylesheet" type="text/css" href="style.css">
  • External style sheets are referred to in the <head> section of an HTML document.

Internal and Inline Styles

  • The <style> tag is used to define an internal style sheet.
  • Inline styles are defined using the style attribute directly within an HTML tag.

CSS Syntax

  • Correct CSS syntax example: body {color: black;}
  • Comments in a CSS file: /* This is a comment */

Color and Background

  • The property used to change the background color: background-color.
  • To add a background color for all <h1> elements: h1 {background-color: #FFFFFF;}

Text Properties

  • The CSS property for changing the text color: color.
  • The property controlling text size: font-size.
  • Making all <p> elements bold: p {font-weight: bold;}

Text Decoration and Capitalization

  • Display hyperlinks without an underline: a {text-decoration: none;}
  • To capitalize each word in a text: text-transform: capitalize;

Font Properties

  • Font can be changed using font-family or font.
  • To make text bold: font-weight: bold;

Borders and Margins

  • Syntax for custom border widths: border-width: 10px 1px 5px 20px;
  • Change the left margin of an element: margin-left.

Padding and Lists

  • Negative values are not allowed when using the padding property.
  • To create a list with square items: list-style-type: square;

Selecting Elements

  • To select an element with id "demo": #demo.
  • To select elements with class name "test": .test.
  • Select all <p> elements inside a <div>: div p.

Grouping and Positioning

  • Group selectors by separating them with a comma.
  • The default value of the position property in CSS: static.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Test your knowledge of CSS with this quiz! Covering topics such as the meaning of CSS, how to link external stylesheets, and more, this quiz is perfect for beginners looking to sharpen their web design skills.

More Like This

CSS Mastery
5 questions

CSS Mastery

WellInformedSugilite2378 avatar
WellInformedSugilite2378
Introduction to CSS Basics
37 questions
CSS негіздері
10 questions

CSS негіздері

RetractableMars avatar
RetractableMars
Introduction to CSS
45 questions

Introduction to CSS

PureStanza7927 avatar
PureStanza7927
Use Quizgecko on...
Browser
Browser