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
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:
| Layer | Position | What it is |
|---|---|---|
| Content | Innermost | The actual text/image of the element (its width and height) |
| Padding | Around content | Transparent space between the content and the border |
| Border | Around padding | The line drawn around the padding and content |
| Margin | Outermost | Transparent space separating this element from its neighbours |
The four layers, from inside to outside, are:
- Content — the actual text or image, sized by
widthandheight. - Padding — clear space inside the box, between the content and the border; it takes the background colour.
- 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.