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 much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} -
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: 260px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} -
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 7.Which of these is padding? (a) the text or picture (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
- 8.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) border (d) padding
- 9.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) padding (d) content
- 10.Which of these is margin? (a) the gap round content (b) a solid or dotted edge (c) space inside the border (d) the gap to other boxes
- 11.Which of these is margin? (a) the gap round content (b) space outside the border (c) the line round the box (d) space inside the border
- 12.📦 In the box model, which part is the gap to other boxes? (a) margin (b) border (c) content (d) padding
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 14.Which of these is padding? (a) the line round the box (b) a solid or dotted edge (c) space inside the border (d) space outside the border
- 15.Which of these is the content? (a) the gap to other boxes (b) space inside the border (c) space outside the border (d) the text or picture
-
16.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 280px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} - 17.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) border (d) padding
- 18.True or false: margin is space outside the border. (a) False (b) True
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 20.True or false: margin is space inside the border. (a) True (b) False
- 21.True or false: the border is the line round the box. (a) False (b) True
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
23.📦 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: 10px;
border: 3px solid black;
margin: 5px;
} -
24.📦 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: 10px;
border: 1px solid black;
margin: 10px;
} - 25.True or false: padding is a solid or dotted edge. (a) False (b) True
-
26.📦 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: 10px;
} - 27.True or false: the content is the gap round content. (a) True (b) False
- 28.True or false: the border is the gap to other boxes. (a) False (b) True
-
29.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} -
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: 220px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 32.True or false: the content is space outside the border. (a) True (b) False
- 33.📦 In the box model, which part is the line round the box? (a) border (b) content (c) margin (d) padding
- 34.Which of these is the border? (a) the line round the box (b) space inside the border (c) the gap to other boxes (d) the text or picture
-
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 140px;
padding: 20px;
border: 5px 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: 290px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
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: 140px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} - 40.Which of these is the border? (a) space outside the border (b) space inside the border (c) the gap round content (d) a solid or dotted edge
Answer key
- 176
- 276
- 178
- 136
- 272
- 154
- the gap round content
- padding
- padding
- the gap to other boxes
- space outside the border
- margin
- 194
- space inside the border
- the text or picture
- 320
- content
- True
- 142
- False
- True
- 108
- 216
- 292
- False
- 182
- False
- False
- 94
- 136
- 238
- False
- border
- the line round the box
- 190
- 328
- 262
- 194
- 248
- a solid or dotted edge
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids