0
0
CSSmarkup~20 mins

Universal selector in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Universal Selector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
1:00remaining
What does the universal selector (*) do in CSS?
Choose the correct description of the universal selector * in CSS.
ASelects only elements with a class attribute.
BSelects only elements with an ID attribute.
CSelects all elements on the page.
DSelects only paragraph elements.
Attempts:
2 left
💡 Hint
Think about what * means in everyday life, like a wildcard.
rendering
intermediate
1:30remaining
What color will all elements have with this CSS?
Given this CSS code:
* { color: red; }

What color will the text of all elements be?
ANo color change
BBlue
CBlack
DRed
Attempts:
2 left
💡 Hint
The universal selector applies styles to every element.
🧠 Conceptual
advanced
2:00remaining
Which CSS rule will NOT be overridden by the universal selector?
Consider these CSS rules:
p { color: blue; }
* { color: red; }

What color will paragraphs have?
ABlue, because the paragraph selector is more specific.
BRed, because the universal selector applies to all elements.
CBlack, because no color is set explicitly.
DGreen, because of browser default styles.
Attempts:
2 left
💡 Hint
Think about CSS specificity and which rule wins.
accessibility
advanced
2:00remaining
Why should you be careful using the universal selector (*) for styling?
Which is a potential accessibility problem when using * to style all elements?
AIt can override focus outlines, making keyboard navigation harder.
BIt automatically adds ARIA labels to all elements.
CIt disables screen readers on the page.
DIt prevents images from loading.
Attempts:
2 left
💡 Hint
Think about how styling focus outlines affects users who use keyboards.
layout
expert
2:30remaining
What is the effect of this CSS on layout?
Given this CSS:
* { margin: 0; padding: 0; box-sizing: border-box; }

What does this do to the page layout?
AAdds default margins and paddings to all elements.
BRemoves all default spacing and makes sizing easier to control.
CBreaks the layout by hiding all elements.
DOnly affects elements with class names.
Attempts:
2 left
💡 Hint
Think about what margin, padding, and box-sizing control.