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 line round the box? (a) content (b) padding (c) margin (d) border
-
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: 290px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 3.True or false: margin is the line round the box. (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: 120px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 5.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
- 6.📦 In the box model, which part is the text or picture? (a) content (b) border (c) padding (d) margin
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 8.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) padding (d) 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: 80px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
12.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
13.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 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: 130px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
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: 10px;
border: 5px solid black;
margin: 10px;
} -
18.📦 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: 10px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} - 20.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
-
21.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 22.Which of these is the content? (a) the text or picture (b) the line round the box (c) the gap round content (d) the gap to other boxes
-
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} - 25.True or false: the border is a solid or dotted edge. (a) True (b) False
- 26.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) padding (d) border
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 31.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) content (d) border
- 32.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) space outside the border (d) space inside the border
-
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: 120px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
35.📦 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: 5px solid black;
margin: 20px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
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: 110px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 2px solid black;
margin: 0px;
}
Answer key
- border
- 312
- False
- 132
- border
- content
- 192
- padding
- 116
- 102
- 122
- 304
- 318
- False
- 180
- 126
- 160
- 204
- 116
- padding
- 308
- the text or picture
- 138
- 170
- True
- margin
- 82
- 100
- 172
- 226
- margin
- space inside the border
- 152
- 222
- 200
- 184
- 252
- 336
- 140
- 304
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids