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 inside the border? (a) padding (b) content (c) border (d) margin
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
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: 100px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 4.Which of these is padding? (a) the line round the box (b) the text or picture (c) space inside the border (d) space outside the border
- 5.True or false: padding is the line round the box. (a) False (b) True
-
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: 110px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 8.Which of these is the content? (a) the gap to other boxes (b) space inside the border (c) the text or picture (d) space outside the border
-
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: 190px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
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: 210px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 11.True or false: the content is space inside the border. (a) False (b) True
- 12.📦 In the box model, which part is a solid or dotted edge? (a) content (b) padding (c) border (d) margin
- 13.True or false: margin is the gap to other boxes. (a) False (b) True
- 14.Which of these is padding? (a) the gap to other boxes (b) a solid or dotted edge (c) the text or picture (d) the gap round content
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 16.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
- 17.📦 In the box model, which part is the gap round content? (a) content (b) margin (c) padding (d) border
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
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: 260px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
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: 280px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 23.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) margin (d) border
-
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: 90px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
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: 70px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 28.Which of these is margin? (a) space outside the border (b) a solid or dotted edge (c) space inside the border (d) the text or picture
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
33.📦 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: 20px;
border: 1px solid black;
margin: 15px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 36.True or false: the border is space outside the border. (a) True (b) False
- 37.True or false: the content is the text or picture. (a) False (b) True
- 38.True or false: the border is the text or picture. (a) False (b) True
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 30px;
border: 2px solid black;
margin: 15px;
}
Answer key
- padding
- 230
- 158
- space inside the border
- False
- 148
- 158
- the text or picture
- 206
- 224
- False
- border
- True
- the gap round content
- 178
- border
- padding
- 196
- 306
- 292
- 130
- 194
- margin
- 156
- 108
- 122
- 170
- space outside the border
- 284
- 192
- 116
- 112
- 92
- 198
- 198
- False
- True
- False
- 264
- 274
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids