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 much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} - 3.Which of these is the content? (a) a solid or dotted edge (b) the text or picture (c) the gap to other boxes (d) the gap round content
-
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: 140px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 5.Which of these is margin? (a) the gap round content (b) the line round the box (c) a solid or dotted edge (d) the gap to other boxes
- 6.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) border (d) padding
- 7.True or false: margin is space inside the border. (a) True (b) False
- 8.True or false: the content is the gap to other boxes. (a) True (b) False
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 11.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
-
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: 90px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 14.True or false: padding is space outside the border. (a) True (b) False
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 16.True or false: the content is space outside the border. (a) False (b) True
-
17.📦 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: 15px;
border: 3px solid black;
margin: 20px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} - 19.True or false: margin is the gap round content. (a) True (b) False
- 20.Which of these is the border? (a) the gap to other boxes (b) the line round the box (c) the gap round content (d) the text or picture
-
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: 270px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} - 24.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) border (d) margin
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
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: 260px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} - 29.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the gap round content (d) space outside the border
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
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: 90px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 32.True or false: the border is the line round the box. (a) False (b) True
- 33.📦 In the box model, which part is the text or picture? (a) border (b) margin (c) padding (d) content
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 39.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) border (d) margin
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 3px solid black;
margin: 15px;
}
Answer key
- True
- 106
- the text or picture
- 158
- the gap to other boxes
- border
- False
- False
- 308
- 252
- margin
- 130
- 216
- False
- 124
- False
- 246
- 196
- False
- the line round the box
- 296
- 190
- 310
- border
- 352
- 304
- 190
- 268
- space outside the border
- 148
- 108
- True
- content
- 198
- 210
- 150
- 180
- 254
- margin
- 226
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids