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.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 2.True or false: padding is space inside the border. (a) True (b) False
-
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: 70px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} - 4.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} -
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} - 7.True or false: margin is a solid or dotted edge. (a) False (b) True
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 9.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) content (d) border
- 10.Which of these is margin? (a) space inside the border (b) space outside the border (c) a solid or dotted edge (d) the gap round content
- 11.True or false: the border is space outside the border. (a) False (b) True
- 12.True or false: padding is space outside the border. (a) False (b) True
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} - 14.Which of these is the content? (a) the gap to other boxes (b) space outside the border (c) the text or picture (d) the gap round content
- 15.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) margin (d) border
-
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: 300px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} - 18.True or false: padding is the text or picture. (a) True (b) False
-
19.📦 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: 10px;
border: 1px solid black;
margin: 15px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 22.True or false: margin is space outside the border. (a) True (b) False
- 23.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) padding (d) border
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
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: 210px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 31.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) padding (d) margin
- 32.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) border (d) margin
- 33.True or false: the border is a solid or dotted edge. (a) False (b) True
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
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: 160px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 38.True or false: the content is the text or picture. (a) True (b) False
-
39.📦 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: 5px;
border: 2px 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: 160px;
padding: 10px;
border: 1px solid black;
margin: 0px;
}
Answer key
- 214
- True
- 130
- padding
- 160
- 120
- False
- 134
- border
- space outside the border
- False
- False
- 372
- the text or picture
- border
- 366
- 254
- False
- 132
- 334
- 96
- True
- margin
- 136
- 194
- 92
- 270
- 238
- 208
- 108
- margin
- padding
- True
- 158
- 244
- 254
- 188
- True
- 194
- 182
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids