Recall & Review
beginner
What is the utility-first approach in CSS?
It is a way to style web pages by using many small, single-purpose classes directly in HTML to control layout and appearance, instead of writing big CSS rules.
Click to reveal answer
beginner
How does traditional CSS differ from utility-first CSS?
Traditional CSS uses separate style rules written in CSS files targeting elements or classes, while utility-first CSS applies many small classes directly in HTML to style elements quickly.
Click to reveal answer
beginner
What is one advantage of utility-first CSS?
It helps build designs faster by reusing small classes and reduces the need to write custom CSS, making changes quicker and easier.
Click to reveal answer
intermediate
What is a common challenge when using utility-first CSS?
HTML can become cluttered with many classes, which might be harder to read or maintain for some developers.
Click to reveal answer
beginner
Give an example of a utility class in Tailwind CSS and its effect.The class
text-center centers the text inside an element horizontally.Click to reveal answer
Which of the following best describes utility-first CSS?
✗ Incorrect
Utility-first CSS uses many small, single-purpose classes directly in HTML to style elements.
In traditional CSS, where are styles usually written?
✗ Incorrect
Traditional CSS styles are written in separate CSS files or inside style tags in HTML.
What is a potential downside of utility-first CSS?
✗ Incorrect
Utility-first CSS can make HTML look crowded because of many small classes.
Which Tailwind class would you use to add margin on all sides?
✗ Incorrect
The class
m-4 adds margin on all sides in Tailwind CSS.Why might developers prefer utility-first CSS for rapid prototyping?
✗ Incorrect
Utility-first CSS lets developers quickly style elements by adding small classes directly in HTML.
Explain the main differences between utility-first CSS and traditional CSS.
Think about where styles live and how they are applied.
You got /4 concepts.
Describe one advantage and one challenge of using utility-first CSS.
Consider speed and code readability.
You got /2 concepts.