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.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) border (d) padding
- 2.True or false: the content is space inside the border. (a) False (b) True
- 3.True or false: padding is the line round the box. (a) True (b) False
- 4.Which of these is margin? (a) the gap to other boxes (b) a solid or dotted edge (c) the gap round content (d) the line round the box
- 5.Which of these is the border? (a) the text or picture (b) a solid or dotted edge (c) the gap to other boxes (d) space outside the border
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 7.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) the gap round content (d) space outside the border
- 8.📦 In the box model, which part is space inside the border? (a) margin (b) padding (c) content (d) border
- 9.True or false: margin is the gap to other boxes. (a) False (b) True
- 10.True or false: the content is the line round the box. (a) True (b) False
-
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
14.📦 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: 30px;
border: 4px solid black;
margin: 10px;
} - 15.Which of these is the content? (a) the text or picture (b) the gap to other boxes (c) space outside the border (d) space inside the border
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} - 18.Which of these is margin? (a) the gap round content (b) space outside the border (c) a solid or dotted edge (d) space inside the border
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} -
21.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} - 23.True or false: margin is the line round the box. (a) False (b) True
- 24.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) the line round the box (d) space outside the border
- 25.📦 In the box model, which part is a solid or dotted edge? (a) content (b) border (c) margin (d) padding
-
26.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 210px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
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: 110px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 29.📦 In the box model, which part is the gap round content? (a) padding (b) content (c) margin (d) border
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
32.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 230px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 34.Which of these is padding? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) space outside the border
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
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: 70px;
padding: 5px;
border: 1px solid black;
margin: 10px;
}
Answer key
- margin
- False
- False
- the gap to other boxes
- a solid or dotted edge
- 302
- the gap round content
- padding
- True
- False
- 204
- 176
- 336
- 368
- the text or picture
- 232
- 196
- space outside the border
- 134
- 196
- 98
- 108
- False
- the line round the box
- border
- 248
- 162
- 144
- padding
- 190
- 272
- 288
- 154
- space inside the border
- 208
- 150
- 240
- 334
- 276
- 82
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids