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: the border is space outside the border. (a) False (b) True
- 2.Which of these is margin? (a) the gap round content (b) space inside the border (c) space outside the border (d) the text or picture
-
3.📦 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: 5px solid black;
margin: 10px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 5.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
- 6.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) margin (d) border
- 7.📦 In the box model, which part is the text or picture? (a) border (b) content (c) padding (d) margin
- 8.True or false: the content is the text or picture. (a) True (b) False
- 9.📦 In the box model, which part is the gap to other boxes? (a) padding (b) border (c) content (d) margin
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} - 11.📦 In the box model, which part is the gap round content? (a) border (b) content (c) padding (d) margin
-
12.📦 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: 25px;
border: 2px solid black;
margin: 5px;
} - 13.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
- 14.True or false: padding is space inside the border. (a) True (b) False
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
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: 170px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
17.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 180px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 1px 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: 70px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
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: 230px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
24.📦 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: 2px solid black;
margin: 20px;
} - 25.True or false: padding is the text or picture. (a) True (b) False
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
27.📦 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: 5px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
31.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 150px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} - 32.Which of these is the border? (a) the text or picture (b) the line round the box (c) space inside the border (d) the gap round content
- 33.📦 In the box model, which part is space outside the border? (a) content (b) border (c) padding (d) margin
-
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: 230px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
36.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 280px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} - 38.True or false: padding is the line round the box. (a) True (b) False
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
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: 100px;
padding: 5px;
border: 1px solid black;
margin: 5px;
}
Answer key
- False
- space outside the border
- 250
- 198
- border
- border
- content
- True
- margin
- 240
- padding
- 174
- padding
- True
- 208
- 226
- 212
- 190
- 232
- 94
- 274
- 204
- 182
- 284
- False
- 124
- 90
- 182
- 314
- 122
- 220
- the line round the box
- margin
- 290
- 118
- 310
- 240
- False
- 134
- 112
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids