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 text or picture? (a) margin (b) padding (c) border (d) content
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} - 4.Which of these is the border? (a) a solid or dotted edge (b) space inside the border (c) the gap to other boxes (d) the text or picture
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
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: 180px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} - 7.Which of these is margin? (a) the text or picture (b) the line round the box (c) space outside the border (d) space inside the border
- 8.True or false: the content is the text or picture. (a) True (b) False
-
9.📦 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: 25px;
border: 1px solid black;
margin: 20px;
} -
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: 180px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} -
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 16.📦 In the box model, which part is the gap round content? (a) content (b) border (c) padding (d) margin
- 17.Which of these is padding? (a) a solid or dotted edge (b) the text or picture (c) space outside the border (d) the gap round content
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} - 19.Which of these is padding? (a) the gap to other boxes (b) a solid or dotted edge (c) the line round the box (d) space inside the border
- 20.Which of these is the content? (a) a solid or dotted edge (b) the gap to other boxes (c) space outside the border (d) the text or picture
- 21.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) padding (d) margin
-
22.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 240px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 23.Which of these is the border? (a) space outside the border (b) the line round the box (c) the text or picture (d) the gap to other boxes
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 27.True or false: the border is space inside the border. (a) True (b) False
- 28.True or false: the border is the text or picture. (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: 100px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 31.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) padding (d) border
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} -
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 34.True or false: padding is the gap round content. (a) True (b) False
- 35.True or false: margin is the gap round content. (a) False (b) True
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
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: 130px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} - 38.True or false: the content is the gap to other boxes. (a) True (b) False
- 39.True or false: the content is the line round the box. (a) False (b) True
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 15px;
border: 3px solid black;
margin: 20px;
}
Answer key
- content
- 62
- 226
- a solid or dotted edge
- 202
- 240
- space outside the border
- True
- 152
- 222
- 322
- 236
- 198
- 166
- 154
- padding
- the gap round content
- 172
- space inside the border
- the text or picture
- border
- 264
- the line round the box
- 152
- 232
- 140
- False
- False
- 150
- 62
- border
- 330
- 106
- True
- False
- 122
- 154
- False
- False
- 366
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids