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 space inside the border? (a) margin (b) content (c) border (d) padding
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} - 3.Which of these is padding? (a) the text or picture (b) space outside the border (c) a solid or dotted edge (d) space inside the border
- 4.📦 In the box model, which part is the text or picture? (a) content (b) margin (c) border (d) padding
-
5.📦 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;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
8.📦 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: 10px;
border: 4px solid black;
margin: 10px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 10.True or false: margin is the gap round content. (a) True (b) False
- 11.True or false: padding is the text or picture. (a) False (b) True
- 12.True or false: the border is the line round the box. (a) True (b) False
- 13.📦 In the box model, which part is space outside the border? (a) border (b) content (c) padding (d) margin
- 14.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) content (d) padding
- 15.True or false: padding is a solid or dotted edge. (a) True (b) False
- 16.True or false: padding is space outside the border. (a) False (b) True
- 17.Which of these is padding? (a) the line round the box (b) the gap round content (c) a solid or dotted edge (d) space outside the border
-
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: 50px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 19.True or false: the border is the text or picture. (a) False (b) True
- 20.Which of these is the content? (a) space inside the border (b) the text or picture (c) a solid or dotted edge (d) the line round the box
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 22.Which of these is the border? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
- 23.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 25.Which of these is margin? (a) space inside the border (b) the text or picture (c) the gap round content (d) the gap to other boxes
-
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: 50px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
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: 210px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 31.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
- 32.True or false: the border is the gap to other boxes. (a) True (b) False
- 33.True or false: the content is the line round the box. (a) False (b) True
- 34.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) margin (d) border
-
35.📦 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: 15px;
} -
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: 250px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 25px;
border: 4px solid black;
margin: 10px;
}
Answer key
- padding
- 186
- space inside the border
- content
- 182
- 222
- 284
- 198
- 166
- False
- False
- True
- margin
- padding
- False
- False
- the gap round content
- 84
- False
- the text or picture
- 162
- a solid or dotted edge
- border
- 256
- the gap to other boxes
- 114
- 178
- 310
- 174
- 248
- space outside the border
- False
- False
- border
- 192
- 280
- 212
- 218
- 118
- 158
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids