CSS Worksheet: Box Model
Code tip (Inside out, twice): From the inside out: content → padding → border → margin. Border to border = width + 2 × padding + 2 × border. Total space = width + 2 × padding + 2 × border + 2 × margin.
NameDateTime takenScore ___ / 40
- 1.True or false: padding is space inside the border. (a) False (b) True
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 3.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) padding (d) border
- 4.📦 In the box model, which part is space outside the border? (a) padding (b) content (c) border (d) margin
-
5.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} - 7.True or false: padding is space outside the border. (a) False (b) True
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
9.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 300px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 60px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 11.Which of these is margin? (a) the gap round content (b) space outside the border (c) space inside the border (d) the text or picture
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} - 13.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) padding (d) margin
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
16.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 20.Which of these is the border? (a) space inside the border (b) the gap round content (c) space outside the border (d) the line round the box
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} - 22.True or false: the border is the gap round content. (a) False (b) True
- 23.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
- 24.📦 In the box model, which part is the text or picture? (a) content (b) margin (c) padding (d) border
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
28.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 160px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 30.📦 In the box model, which part is the gap round content? (a) content (b) margin (c) padding (d) border
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 32.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) space outside the border
- 33.Which of these is the content? (a) space inside the border (b) the gap to other boxes (c) the text or picture (d) the gap round content
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 36.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
-
37.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} -
40.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 110px;
padding: 20px;
border: 5px solid black;
margin: 15px;
}
Answer key
- True
- 188
- border
- margin
- 214
- 196
- False
- 206
- 334
- 74
- space outside the border
- 134
- margin
- 164
- 120
- 228
- 206
- 116
- 224
- the line round the box
- 206
- False
- border
- content
- 282
- 206
- 128
- 220
- 216
- padding
- 122
- the gap round content
- the text or picture
- 216
- 94
- padding
- 210
- 266
- 350
- 160
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids