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.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 2.Which of these is margin? (a) the gap round content (b) the gap to other boxes (c) space inside the border (d) the line round the box
-
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: 10px;
border: 1px solid black;
margin: 20px;
} - 4.Which of these is the content? (a) space outside the border (b) the line round the box (c) the text or picture (d) a solid or dotted edge
-
5.📦 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: 25px;
border: 1px solid black;
margin: 0px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} - 7.True or false: margin is a solid or dotted edge. (a) False (b) True
- 8.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) padding (d) border
-
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: 130px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 10.True or false: the content is space inside the border. (a) True (b) False
- 11.📦 In the box model, which part is the line round the box? (a) border (b) margin (c) padding (d) content
- 12.True or false: the content is the gap to other boxes. (a) False (b) True
- 13.Which of these is padding? (a) space outside the border (b) the gap round content (c) a solid or dotted edge (d) the line round the box
- 14.True or false: padding is the gap to other boxes. (a) False (b) True
-
15.📦 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: 20px;
border: 4px solid black;
margin: 0px;
} - 16.True or false: margin is the gap round content. (a) True (b) False
- 17.Which of these is the border? (a) space inside the border (b) the gap round content (c) space outside the border (d) a solid or dotted edge
-
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: 170px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 19.Which of these is the border? (a) space outside the border (b) the gap round content (c) the line round the box (d) the gap to other boxes
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
22.📦 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: 15px;
border: 3px solid black;
margin: 10px;
} - 23.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
27.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 160px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 29.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) content (d) padding
-
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: 290px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 31.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
- 32.True or false: padding is space outside the border. (a) True (b) False
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
37.📦 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: 5px;
} -
38.📦 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: 30px;
border: 1px solid black;
margin: 20px;
} - 39.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) space inside the border (d) the line round the box
- 40.True or false: padding is the line round the box. (a) False (b) True
Answer key
- 128
- the gap to other boxes
- 72
- the text or picture
- 272
- 198
- False
- padding
- 160
- False
- border
- False
- the gap round content
- False
- 268
- False
- a solid or dotted edge
- 182
- the line round the box
- 148
- 334
- 96
- padding
- 134
- 214
- 364
- 214
- 202
- margin
- 304
- border
- False
- 162
- 204
- 244
- 210
- 252
- 282
- space inside the border
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids