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 the gap round content? (a) padding (b) border (c) margin (d) content
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} - 3.📦 In the box model, which part is space outside the border? (a) padding (b) border (c) content (d) margin
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 5.Which of these is the content? (a) a solid or dotted edge (b) space inside the border (c) the text or picture (d) the gap to other boxes
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 8.Which of these is margin? (a) a solid or dotted edge (b) the text or picture (c) the gap to other boxes (d) the gap round content
-
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: 60px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} - 12.True or false: margin is space outside the border. (a) True (b) False
- 13.📦 In the box model, which part is space inside the border? (a) border (b) content (c) margin (d) padding
-
14.📦 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;
} -
15.📦 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: 20px;
} - 16.True or false: margin is the line round the box. (a) True (b) False
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 18.Which of these is padding? (a) the text or picture (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
- 19.Which of these is the border? (a) the text or picture (b) the line round the box (c) the gap to other boxes (d) the gap round content
- 20.True or false: the content is space inside the border. (a) False (b) True
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} - 22.True or false: padding is a solid or dotted edge. (a) False (b) True
-
23.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 250px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} - 25.📦 In the box model, which part is the line round the box? (a) border (b) content (c) padding (d) margin
-
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: 80px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
29.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 270px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
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: 210px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 33.True or false: margin is the text or picture. (a) False (b) True
- 34.📦 In the box model, which part is the text or picture? (a) padding (b) content (c) border (d) margin
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 37.Which of these is the border? (a) a solid or dotted edge (b) the text or picture (c) the gap round content (d) space inside the border
- 38.True or false: the border is a solid or dotted edge. (a) False (b) True
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 2px solid black;
margin: 0px;
}
Answer key
- padding
- 250
- margin
- 184
- the text or picture
- 214
- 120
- the gap to other boxes
- 72
- 236
- 318
- True
- padding
- 274
- 280
- False
- 212
- space inside the border
- the line round the box
- False
- 172
- False
- 270
- 262
- border
- 144
- 270
- 102
- 336
- 182
- 252
- 200
- False
- content
- 180
- 216
- a solid or dotted edge
- True
- 232
- 184
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids