CSS for Frontend Developers
CSS is the stylesheet language that controls how HTML elements look and are laid out. Rules combine selectors with declarations, and the cascade decides which rule wins using origin, specificity and source order. It handles spacing, Flexbox, Grid, responsive breakpoints and modern features like custom properties and container queries.
Stage: Web Foundations · Part of the Frontend Developer roadmap · Last reviewed 19 November 2026
What to learn in CSS
- Calculate selector specificity to predict which rule wins a conflict
- Explain the box model and switch to box-sizing border-box
- Build one-dimensional layouts with Flexbox and two-dimensional ones with Grid
- Write media queries that adapt a layout from phone to desktop
- Use custom properties to keep colours and spacing consistent
CSS interview questions
How does CSS specificity work?
Specificity ranks selectors by weight: inline styles beat IDs, IDs beat classes, attributes and pseudo-classes, and those beat element selectors. When two rules tie, the later one in source order wins. The important flag overrides this, which is why it is best avoided.
When would you pick Grid over Flexbox?
Use Flexbox to arrange items along a single axis, such as a navbar or a row of buttons. Use Grid when you need to control rows and columns together, like a page layout or a card gallery. They also combine well, with Grid for the page and Flexbox inside cards.
Where CSS fits in the Frontend Developer roadmap
CSS belongs to the Web Foundations stage (beginner level), which takes about 4 hours. How the web works, plus the HTML and CSS every interface is built on.
Other units in this stage
Back to the full Frontend Developer roadmap