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.Which of these is margin? (a) the text or picture (b) the line round the box (c) the gap round content (d) space outside the border
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} - 3.True or false: the border is the line round the box. (a) True (b) False
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 5.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) space outside the border (d) the gap to other boxes
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 8.Which of these is the content? (a) the text or picture (b) the gap round content (c) the line round the box (d) the gap to other boxes
- 9.Which of these is the border? (a) the line round the box (b) the gap to other boxes (c) the text or picture (d) space inside the border
- 10.True or false: margin is a solid or dotted edge. (a) False (b) True
-
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} - 12.True or false: padding is space inside the border. (a) True (b) False
- 13.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) content (d) border
- 14.True or false: the content is a solid or dotted edge. (a) True (b) False
- 15.True or false: margin is space inside the border. (a) True (b) False
-
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: 270px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} - 18.True or false: margin is the gap to other boxes. (a) False (b) True
-
19.📦 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: 5px;
border: 5px solid black;
margin: 15px;
} - 20.📦 In the box model, which part is the text or picture? (a) padding (b) content (c) margin (d) border
- 21.📦 In the box model, which part is space outside the border? (a) border (b) content (c) margin (d) padding
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 23.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) content (d) margin
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 25.True or false: padding is the line round the box. (a) False (b) True
- 26.Which of these is padding? (a) the line round the box (b) the text or picture (c) space inside the border (d) space outside the border
-
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: 60px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
28.📦 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: 30px;
border: 1px solid black;
margin: 5px;
} -
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: 130px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} - 30.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 33.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) margin (d) content
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
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: 120px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
37.📦 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: 25px;
border: 2px solid black;
margin: 0px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 1px solid black;
margin: 5px;
}
Answer key
- space outside the border
- 256
- True
- 158
- a solid or dotted edge
- 162
- 196
- the text or picture
- the line round the box
- False
- 240
- True
- margin
- False
- False
- 338
- 142
- True
- 310
- content
- margin
- 64
- padding
- 198
- False
- space inside the border
- 120
- 282
- 166
- border
- 172
- 150
- border
- 152
- 174
- 106
- 264
- 114
- 156
- 182
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids