Challenge - 5 Problems
CSS Syntax Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the output of this CSS snippet?
Given the CSS below, what color will the paragraph text be rendered in a browser?
CSS
p { color: blue; color: red; }Attempts:
2 left
💡 Hint
Later rules override earlier ones if they have the same specificity.
✗ Incorrect
The last color property in the same rule overrides the previous one. So the paragraph text will be red.
❓ selector
intermediate2:00remaining
Which selector matches only direct children?
Which CSS selector matches only the direct children of a
div element?Attempts:
2 left
💡 Hint
Look for the selector that uses the child combinator symbol.
✗ Incorrect
The > symbol selects only direct children. So div > p matches p elements that are immediate children of div.
❓ layout
advanced2:00remaining
What layout will this CSS produce?
Given the CSS below, how will the three boxes be arranged visually?
CSS
.container { display: flex; flex-direction: column; gap: 1rem; } .box { width: 100px; height: 100px; background-color: lightblue; }
Attempts:
2 left
💡 Hint
Check the
flex-direction property value.✗ Incorrect
The container uses flexbox with flex-direction: column, so boxes stack vertically. The gap adds space between them.
❓ accessibility
advanced2:00remaining
Which CSS rule improves text accessibility?
Which CSS rule below best improves text readability for users with visual impairments?
Attempts:
2 left
💡 Hint
Good contrast between text and background helps readability.
✗ Incorrect
Black text on white background (#000 on #fff) provides the highest contrast, making text easier to read.
🧠 Conceptual
expert2:00remaining
What error does this CSS cause?
What error or issue will this CSS cause when applied in a browser?
CSS
div {
color: blue;
background-color: yellow;
}Attempts:
2 left
💡 Hint
Check punctuation between CSS declarations.
✗ Incorrect
Missing semicolon after color: blue causes a syntax error, so the browser ignores the entire rule or stops parsing at that point.