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: padding is space inside the border. (a) False (b) True
-
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: 180px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 3.True or false: the border is space inside the border. (a) False (b) True
-
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: 90px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 5.True or false: padding is the gap round content. (a) False (b) True
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 8.True or false: padding is the text or picture. (a) False (b) True
- 9.📦 In the box model, which part is the gap round content? (a) border (b) content (c) margin (d) padding
-
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: 180px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 11.True or false: padding is the line round the box. (a) False (b) True
- 12.📦 In the box model, which part is a solid or dotted edge? (a) border (b) padding (c) margin (d) content
- 13.Which of these is the content? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
- 14.True or false: padding is the gap to other boxes. (a) False (b) True
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 16.True or false: margin is the gap to other boxes. (a) False (b) True
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
18.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 220px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} - 23.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
- 24.True or false: margin is the text or picture. (a) False (b) True
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 27.Which of these is margin? (a) the gap round content (b) the line round the box (c) the text or picture (d) the gap to other boxes
-
28.📦 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: 2px solid black;
margin: 15px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} -
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: 280px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 31.True or false: the content is the gap round content. (a) True (b) False
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 34.True or false: padding is a solid or dotted edge. (a) False (b) True
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} -
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: 170px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 38.Which of these is margin? (a) the text or picture (b) the line round the box (c) space inside the border (d) space outside the border
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 1px solid black;
margin: 5px;
}
Answer key
- True
- 232
- False
- 116
- True
- 148
- 218
- False
- padding
- 236
- False
- border
- the text or picture
- False
- 118
- True
- 192
- 250
- 236
- 320
- 234
- 146
- padding
- False
- 212
- 300
- the gap to other boxes
- 214
- 90
- 296
- False
- 330
- 350
- False
- 240
- 208
- 298
- space outside the border
- 232
- 172
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids