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 top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
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: 130px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 4.True or false: the border is the line round the box. (a) True (b) False
- 5.True or false: the content is a solid or dotted edge. (a) False (b) True
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} - 7.True or false: margin is space inside the border. (a) True (b) False
- 8.True or false: the border is space inside the border. (a) False (b) True
-
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
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: 200px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 12.True or false: padding is space outside the border. (a) False (b) True
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
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: 240px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 15.Which of these is the border? (a) space inside the border (b) the text or picture (c) space outside the border (d) the line round the box
-
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: 280px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 18.True or false: the border is the gap to other boxes. (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: 210px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 20.Which of these is the content? (a) the text or picture (b) a solid or dotted edge (c) the line round the box (d) space inside the border
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
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: 60px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} - 31.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
-
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 34.📦 In the box model, which part is a solid or dotted edge? (a) content (b) padding (c) margin (d) border
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 36.True or false: margin is the line round the box. (a) False (b) True
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 38.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
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: 80px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} - 40.📦 In the box model, which part is space outside the border? (a) border (b) content (c) margin (d) padding
Answer key
- 218
- 158
- 198
- True
- False
- 204
- False
- False
- 156
- 256
- 144
- False
- 150
- 302
- the line round the box
- 316
- 178
- False
- 268
- the text or picture
- 300
- 232
- 282
- 92
- 222
- 240
- 218
- 260
- 342
- 248
- padding
- 206
- 346
- border
- 264
- False
- 378
- content
- 118
- margin
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids