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) margin (b) padding (c) content (d) border
-
2.📦 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: 1px solid black;
margin: 20px;
} - 3.Which of these is the content? (a) the text or picture (b) the gap round content (c) the line round the box (d) space outside the border
- 4.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) the text or picture (d) the line round the box
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 6.Which of these is padding? (a) space outside the border (b) space inside the border (c) the line round the box (d) a solid or dotted edge
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 8.True or false: the border is space outside the border. (a) False (b) True
- 9.True or false: the border is a solid or dotted edge. (a) True (b) False
-
10.📦 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: 5px;
border: 2px solid black;
margin: 10px;
} - 11.📦 In the box model, which part is space outside the border? (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: 90px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 13.True or false: margin is the line round the box. (a) False (b) True
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
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: 100px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} - 16.True or false: margin is the gap to other boxes. (a) False (b) True
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 19.True or false: the content is a solid or dotted edge. (a) True (b) False
-
20.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 110px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 22.True or false: the content is the text or picture. (a) True (b) False
- 23.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) padding (d) border
- 24.Which of these is the border? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
- 25.True or false: padding is the gap round content. (a) True (b) False
-
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} -
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: 150px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 30.True or false: margin is space outside the border. (a) False (b) True
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 32.True or false: the content 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: 260px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} - 34.Which of these is margin? (a) space outside the border (b) space inside the border (c) the line round the box (d) the text or picture
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
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: 270px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} - 37.Which of these is the border? (a) the gap to other boxes (b) the line round the box (c) space outside the border (d) space inside the border
-
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 39.True or false: the border is space inside the border. (a) False (b) True
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 4px solid black;
margin: 10px;
}
Answer key
- border
- 102
- the text or picture
- the gap round content
- 158
- space inside the border
- 166
- False
- True
- 264
- margin
- 162
- False
- 294
- 118
- True
- 204
- 238
- False
- 174
- 164
- True
- padding
- a solid or dotted edge
- True
- 124
- 208
- 258
- 224
- True
- 154
- False
- 336
- space outside the border
- 194
- 338
- the line round the box
- 224
- False
- 348
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids