Skill Zuno · skillzunos.com · Fullstack
CSS interview questions
Prepare for CSS interviews on Skill Zuno. This practice book covers CSS interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.
Open CSS on Skill ZunoAlso see the CSS tutorial.
CSS controls how HTML is presented: layout, colour, typography, spacing and animation. Modern CSS adds Flexbox, Grid, custom properties, container queries and powerful selectors. CSS interviews focus on the cascade and specificity, the box model, positioning, Flexbox and Grid layout, and responsive design.
Sample CSS interview questions
How is specificity calculated?
Specificity is compared as three counts: IDs, then classes, attributes and pseudo-classes, then elements and pseudo-elements. Inline styles beat all selectors and !important beats normal declarations; equal specificity falls back to source order.
What does box-sizing: border-box do?
With border-box, width and height include padding and border, so a 200px box stays 200px wide when padding is added. The default content-box adds padding and border on top of the width.
When should you use Flexbox versus Grid?
Flexbox lays items out in one dimension, a row or a column, and suits components such as toolbars. Grid controls rows and columns together and suits page layouts and anything that must align in two directions.
What is a stacking context?
A stacking context is a group of elements layered together. Properties such as position with z-index, opacity below 1 and transform create one, and z-index only orders elements within the same stacking context.
What is the difference between em, rem and px?
px is a fixed unit. em is relative to the element's own font size, so it compounds when nested. rem is relative to the root font size, which makes it predictable and respects the user's browser font setting.
What you can practice
- CSS interview questions for beginners and experienced developers
- Level-based practice: New, Easy, Medium, Hard, and Diff
- Fullstack topics alongside CSS on skillzunos.com