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 the gap to other boxes? (a) padding (b) content (c) margin (d) border
-
2.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 250px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 3.True or false: the border is the text or picture. (a) True (b) False
-
4.📦 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: 25px;
border: 3px solid black;
margin: 0px;
} - 5.Which of these is the content? (a) the gap to other boxes (b) space inside the border (c) space outside the border (d) the text or picture
-
6.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
7.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 100px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 8.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) margin (d) content
- 9.📦 In the box model, which part is the line round the box? (a) content (b) border (c) padding (d) margin
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 12.True or false: the border is a solid or dotted edge. (a) False (b) True
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 15.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) border (d) padding
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
20.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 260px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
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: 210px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
22.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 50px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
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: 120px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 27.True or false: padding is space inside the border. (a) True (b) False
- 28.Which of these is margin? (a) a solid or dotted edge (b) the text or picture (c) space inside the border (d) the gap to other boxes
-
29.📦 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: 10px;
border: 4px solid black;
margin: 5px;
} -
30.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 260px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 31.Which of these is padding? (a) space outside the border (b) the line round the box (c) the gap to other boxes (d) space inside the border
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 1px solid black;
margin: 20px;
} - 33.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) margin (d) content
-
34.📦 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: 20px;
} -
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: 260px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 37.True or false: the border is the gap to other boxes. (a) False (b) True
- 38.Which of these is the border? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) a solid or dotted edge
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 2px solid black;
margin: 15px;
}
Answer key
- margin
- 300
- False
- 266
- the text or picture
- 334
- 142
- border
- border
- 204
- 212
- True
- 224
- 124
- margin
- 276
- 220
- 262
- 280
- 328
- 226
- 88
- 330
- 218
- 264
- 168
- True
- the gap to other boxes
- 88
- 312
- space inside the border
- 232
- padding
- 228
- 322
- 240
- False
- a solid or dotted edge
- 164
- 224
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids