Skip to content
Short Answer Questions · Q8

Q.Explain the CSS box model with the help of a diagram. Name its four layers from inside to outside.

Maharashtra MsbshseTextbookSubjectiveImportance★★★★★est
67% · 8/12 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

In CSS, the browser treats every element as a rectangular box. The box model describes the layers that make up that box, which together determine its size and the space around it.

The CSS box model wraps every element in four nested layers, from innermost to outermost:

LayerPositionWhat it is
ContentInnermostThe actual text/image of the element (its width and height)
PaddingAround contentTransparent space between the content and the border
BorderAround paddingThe line drawn around the padding and content
MarginOutermostTransparent space separating this element from its neighbours

The four layers, from inside to outside, are:

  1. Content — the actual text or image, sized by width and height.
  2. Padding — clear space inside the box, between the content and the border; it takes the background colour.
  3. Border — a line drawn around the padding and content. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.