Recall & Review
beginner Click to reveal answer
What does the universal selector (*) do in CSS?
The universal selector (*) matches all elements on the page. It applies styles to every HTML element.
beginner Click to reveal answer
How do you write a CSS rule that sets the font color to blue for all elements using the universal selector?
You write:
* { color: blue; } This changes the text color of every element to blue.intermediate Click to reveal answer
True or False: The universal selector can be combined with other selectors to narrow down styling.
True. For example,
div * selects all elements inside div elements.intermediate Click to reveal answer
Why should you be careful when using the universal selector (*) in CSS?
Because it applies styles to every element, it can slow down the page and override specific styles unintentionally.
beginner Click to reveal answer
Give an example of using the universal selector to reset margin and padding for all elements.
Example:
* { margin: 0; padding: 0; } This removes default spacing from all elements, useful for consistent layout.What does the CSS universal selector (*) select?
✗ Incorrect
The universal selector (*) matches every element in the HTML document.
Which CSS rule uses the universal selector to remove all default margin and padding?
✗ Incorrect
The rule with * applies margin and padding reset to all elements.
What is a potential downside of using the universal selector (*) in CSS?
✗ Incorrect
Applying styles to all elements can slow down rendering and cause unintended style overrides.
How can you select all elements inside a <section> using the universal selector?
✗ Incorrect
The selector 'section *' selects every element inside all elements.
Which of these selectors is the universal selector?
✗ Incorrect
The asterisk (*) is the universal selector in CSS.
Explain what the universal selector (*) does in CSS and give a simple example.
Think about how you would style every element on a page at once.
You got /3 concepts.
Describe one advantage and one disadvantage of using the universal selector in your CSS.
Consider performance and control over styling.
You got /2 concepts.
