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) border (c) margin (d) content
- 2.Which of these is the border? (a) space outside the border (b) the gap round content (c) space inside the border (d) the line round the box
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 4.True or false: margin is the gap to other boxes. (a) False (b) True
-
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: 60px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
6.📦 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: 30px;
border: 2px solid black;
margin: 5px;
} - 7.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) margin (d) border
- 8.Which of these is padding? (a) space inside the border (b) the gap to other boxes (c) space outside the border (d) the line round the box
- 9.Which of these is margin? (a) space outside the border (b) the line round the box (c) the text or picture (d) a solid or dotted edge
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 11.True or false: the content is the text or picture. (a) False (b) True
- 12.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
- 13.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) padding (d) content
-
14.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 17.True or false: the border is the line round the box. (a) True (b) False
- 18.True or false: the border is the gap to other boxes. (a) False (b) True
- 19.Which of these is the border? (a) the text or picture (b) a solid or dotted edge (c) the gap to other boxes (d) space inside the border
-
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: 150px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 21.True or false: margin is the line round the box. (a) True (b) False
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 23.True or false: the content is space inside the border. (a) True (b) False
- 24.True or false: padding is the gap round content. (a) True (b) False
- 25.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
- 26.True or false: padding is space inside the border. (a) False (b) True
-
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: 50px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 29.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) border (d) content
-
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: 90px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
33.📦 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: 30px;
border: 3px solid black;
margin: 0px;
} -
34.📦 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: 15px;
border: 4px solid black;
margin: 5px;
} - 35.Which of these is padding? (a) the text or picture (b) space outside the border (c) the line round the box (d) the gap round content
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} - 39.Which of these is margin? (a) the text or picture (b) space inside the border (c) the gap to other boxes (d) the gap round content
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 1px solid black;
margin: 15px;
}
Answer key
- border
- the line round the box
- 236
- True
- 78
- 154
- padding
- space inside the border
- space outside the border
- 194
- True
- border
- margin
- 202
- 296
- 136
- True
- False
- a solid or dotted edge
- 164
- False
- 278
- False
- True
- content
- True
- 62
- 112
- margin
- 120
- 178
- 264
- 136
- 258
- the gap round content
- 84
- 314
- 248
- the gap to other boxes
- 182
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids