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.Which of these is the content? (a) the line round the box (b) space inside the border (c) the gap round content (d) the text or picture
- 2.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) margin (d) content
-
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: 50px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
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: 50px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 5.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) border (d) content
-
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: 200px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 8.True or false: the content is the text or picture. (a) False (b) True
- 9.Which of these is the border? (a) space inside the border (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} -
11.📦 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: 15px;
border: 4px solid black;
margin: 0px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 13.Which of these is padding? (a) the text or picture (b) space outside the border (c) the gap to other boxes (d) space inside the border
- 14.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) the line round the box (d) the gap round content
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 16.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) the text or picture (d) space outside the border
- 17.📦 In the box model, which part is space inside the border? (a) padding (b) margin (c) content (d) border
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 22.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
25.📦 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: 2px solid black;
margin: 0px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
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: 20px;
border: 2px solid black;
margin: 15px;
} - 30.True or false: padding is the gap round content. (a) False (b) True
- 31.📦 In the box model, which part is space outside the border? (a) padding (b) content (c) border (d) margin
- 32.True or false: margin is space outside the border. (a) False (b) True
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
34.📦 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: 20px;
} - 35.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) border (d) padding
-
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: 190px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} - 38.True or false: the content is the gap round content. (a) True (b) False
- 39.Which of these is margin? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) space outside the border
-
40.📦 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: 15px;
border: 5px solid black;
margin: 10px;
}
Answer key
- the text or picture
- content
- 110
- 70
- margin
- 246
- 234
- True
- a solid or dotted edge
- 216
- 298
- 248
- space inside the border
- the line round the box
- 250
- the gap round content
- padding
- 250
- 202
- 204
- 298
- border
- 208
- 288
- 264
- 196
- 138
- 240
- 214
- True
- margin
- True
- 194
- 224
- border
- 202
- 196
- False
- space outside the border
- 330
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids