CSS Interview Questions
Interview questions covering css fundamentals.
CSS Box Model
Understand the CSS box model: content, padding, border and margin, how box-sizing changes width and height calculations, and common layout pitfalls.
How to center a div
How to center a div using CSS. Learn four approaches: flexbox, grid, margin auto and absolute positioning, and when to choose each one in your layouts.
margin vs padding
CSS margin vs padding and the box model explained: when to use each, margin collapse, box-sizing, and a cheat sheet for buttons, cards, and layouts.
Difference between px, rem, em units
Learn the difference between px, em and rem units in CSS: how each one is calculated, how they scale, and when to use them for accessible, responsive design.
Difference between reset.css and normalize.css
Learn the difference between reset.css and normalize.css: how each handles browser default styles, their trade-offs, and which one to pick for your project.
CSS Specificity: How the Browser Picks a Winner
CSS specificity explained with diagrams: how to calculate it, why 11 classes don't beat one ID, and how !important, :is(), :where() and @layer change the rules.
z-index css
Understand CSS z-index and stacking contexts: how elements are layered, which properties create a new stacking context, and why z-index sometimes fails.