Recall & Review
beginner
What are the four parts of the CSS box model?
The four parts are: content, padding, border, and margin. They build outward from the content area.
Click to reveal answer
beginner
How do you calculate the total width of a box in CSS?
Total width = content width + left padding + right padding + left border + right border + left margin + right margin.
Click to reveal answer
intermediate
What CSS property changes how the box model calculates width and height?
The
box-sizing property. content-box (default) counts width and height as content only. border-box includes padding and border inside the width and height.Click to reveal answer
beginner
If a box has width: 200px, padding: 10px, border: 5px, and margin: 20px, what is its total width?
Total width = 200 + 10*2 + 5*2 + 20*2 = 200 + 20 + 10 + 40 = 270px.
Click to reveal answer
beginner
Why is understanding the box model important for web design?
It helps you control spacing and layout precisely. Without it, elements might not appear as expected, causing layout issues.
Click to reveal answer
Which part of the box model is the space between the content and the border?
✗ Incorrect
Padding is the space inside the border, around the content.
What does the CSS property
box-sizing: border-box; do?✗ Incorrect
border-box makes width and height include padding and border.If you want space outside the border, which box model part do you adjust?
✗ Incorrect
Margin is the space outside the border.
What is the default value of the
box-sizing property?✗ Incorrect
The default is
content-box, where width and height apply to content only.Which CSS property controls the thickness of the box's edge?
✗ Incorrect
border-width sets how thick the border is.Explain the CSS box model and how each part affects the size of an element.
Think of a box inside boxes, each adding space around the content.
You got /5 concepts.
Describe how the
box-sizing property changes the way width and height are calculated.Consider what is included inside the width and height.
You got /4 concepts.