Question 3 of 10Pro Only

Explain the CSS box model and the difference between content-box and border-box.

Sample answer preview

The CSS box model describes how elements are sized and spaced. Every element is a rectangular box with four layers: content, padding, border, and margin. Content is the innermost area where text and child elements appear. Padding is space between content and border.

box modelcontent-boxborder-boxpaddingmarginborder

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Frontend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime