Last updated: June 26, 2026
10 of 10 questions
Every element is a box of content, padding, border, and margin. box-sizing controls whether width includes padding and border.
Specificity ranks selectors by inline > ID > class/attribute/pseudo-class > element. Higher specificity wins; ties go to the later rule.
Flexbox is a one-dimensional layout model for distributing space and aligning items along a row or column, ideal for components and toolbars.
Grid is a two-dimensional layout system controlling rows and columns simultaneously; Flexbox is one-dimensional. They complement each other.
static is default; relative offsets from its normal spot; absolute positions to the nearest positioned ancestor; fixed to the viewport; sticky toggles between relative and fixed.
Use a mobile-first approach with fluid units, flexible Grid/Flex layouts, and media or container queries to adapt at breakpoints.
Pseudo-classes (:hover, :nth-child) target an element in a particular state; pseudo-elements (::before, ::first-line) style a generated or sub-part of an element.
px is absolute; em is relative to the element’s font-size; rem to the root; % to the parent; vw/vh to the viewport dimensions.
A stacking context is a self-contained layer; z-index only compares elements within the same context, so a child can’t escape its parent’s stacking order.
Animate only transform and opacity, which the compositor handles on the GPU without layout or paint; avoid animating width, top, or box-shadow.
Upload your resume and get an instant ATS score with keyword gaps — free, no sign-up.
HTML Interview Questions
10 questions
JavaScript Interview Questions
50 questions
React Interview Questions