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) padding (b) content (c) margin (d) border
- 2.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 4.Which of these is the content? (a) the gap round content (b) a solid or dotted edge (c) the line round the box (d) the text or picture
- 5.Which of these is the border? (a) a solid or dotted edge (b) the gap to other boxes (c) space inside the border (d) the gap round content
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 7.True or false: margin is space outside the border. (a) True (b) False
-
8.📦 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;
} - 9.True or false: the content is the text or picture. (a) False (b) True
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} - 11.📦 In the box model, which part is the text or picture? (a) border (b) content (c) margin (d) padding
-
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 13.Which of these is margin? (a) the line round the box (b) space inside the border (c) a solid or dotted edge (d) space outside the border
- 14.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) border (d) margin
- 15.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) margin (d) border
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 19.True or false: margin is the gap to other boxes. (a) True (b) False
- 20.True or false: the border is a solid or dotted edge. (a) False (b) True
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 23.True or false: the content is the gap to other boxes. (a) False (b) True
- 24.True or false: padding is the text or picture. (a) True (b) False
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} - 27.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) border (d) padding
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 30.True or false: the content is the gap round content. (a) True (b) False
-
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: 130px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
32.📦 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: 25px;
border: 1px solid black;
margin: 5px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 34.True or false: the content is a solid or dotted edge. (a) False (b) True
- 35.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) the gap to other boxes (d) space outside the border
- 36.Which of these is padding? (a) space outside the border (b) the gap to other boxes (c) space inside the border (d) the text or picture
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} - 39.True or false: padding is space outside the border. (a) True (b) False
-
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: 90px;
padding: 10px;
border: 4px solid black;
margin: 5px;
}
Answer key
- border
- padding
- 158
- the text or picture
- a solid or dotted edge
- 198
- True
- 116
- True
- 232
- content
- 182
- space outside the border
- margin
- border
- 280
- 170
- 162
- True
- True
- 192
- 334
- False
- False
- 284
- 256
- margin
- 146
- 122
- False
- 148
- 252
- 294
- False
- the gap round content
- space inside the border
- 168
- 340
- False
- 118
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids