Which selector is used to target all `<div>` elements?
A
#div B
.div C
div D
*div
Analysis & Theory
`div` is the correct selector to target all `<div>` elements.
Which property is used to change the font of an element?
A
font-style B
font-family C
text-font D
font-type
Analysis & Theory
`font-family` is used to set the font of the text.
How do you apply a style to elements with class 'highlight'?
A
#highlight B
.highlight C
highlight D
*highlight
Analysis & Theory
`.highlight` targets all elements with `class="highlight"`.
Which of the following is used to add space **inside** an element?
A
margin B
padding C
spacing D
border
Analysis & Theory
`padding` controls the space inside the element, between content and border.
Which value will make the font italic?
A
font-style: italic; B
text-style: italic; C
font: italic; D
style: italic;
Analysis & Theory
`font-style: italic;` correctly sets the font to italic.
How do you set the width of an element to 100 pixels?
A
width = 100; B
element-width: 100px; C
width: 100px; D
size: 100;
Analysis & Theory
`width: 100px;` is the correct syntax to set width.
Which property is used to add space **outside** an element?
A
padding B
margin C
spacing D
border-spacing
Analysis & Theory
`margin` adds space outside the element.
What does `#header` select?
A
An element with class 'header' B
All header elements C
An element with id 'header' D
All elements with name 'header'
Analysis & Theory
`#header` selects the element with `id="header"`.
Which is the correct way to set a border?
A
border: 1px solid black; B
border-width: solid 1px black; C
border-style: 1px solid; D
border-color: black 1px solid;
Analysis & Theory
`border: 1px solid black;` is the correct shorthand syntax.
Which of the following makes the background color yellow?
A
background: yellow; B
bg: yellow; C
bg-color: yellow; D
back-color: yellow;
Analysis & Theory
`background: yellow;` is a valid way to set background color.