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.True or false: padding is space outside the border. (a) False (b) True
- 2.📦 In the box model, which part is the gap to other boxes? (a) margin (b) padding (c) content (d) border
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} -
4.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} - 5.True or false: margin is space outside the border. (a) False (b) True
- 6.Which of these is padding? (a) the line round the box (b) the text or picture (c) a solid or dotted edge (d) the gap round content
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} - 8.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) content (d) margin
- 9.True or false: padding is the gap to other boxes. (a) True (b) False
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 12.Which of these is margin? (a) the gap round content (b) the line round the box (c) space outside the border (d) space inside the border
- 13.Which of these is the content? (a) the text or picture (b) the line round the box (c) the gap to other boxes (d) the gap round content
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
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: 210px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
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: 60px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} - 24.Which of these is the border? (a) a solid or dotted edge (b) space outside the border (c) the gap round content (d) the text or picture
- 25.📦 In the box model, which part is the gap round content? (a) padding (b) content (c) margin (d) border
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
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: 110px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 29.📦 In the box model, which part is space inside the border? (a) border (b) content (c) padding (d) margin
- 30.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) content (d) padding
- 31.Which of these is padding? (a) space outside the border (b) the text or picture (c) a solid or dotted edge (d) space inside the border
- 32.True or false: the border is the gap to other boxes. (a) False (b) True
-
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} - 34.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} - 36.True or false: the border is a solid or dotted edge. (a) True (b) False
- 37.True or false: the border is the line round the box. (a) True (b) False
- 38.Which of these is the border? (a) the line round the box (b) space inside the border (c) the text or picture (d) the gap round content
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 30px;
border: 3px solid black;
margin: 0px;
}
Answer key
- False
- margin
- 124
- 194
- True
- the gap round content
- 266
- content
- False
- 106
- 172
- space outside the border
- the text or picture
- 192
- 176
- 132
- 218
- 210
- 132
- 172
- 232
- 228
- 76
- a solid or dotted edge
- padding
- 124
- 168
- 136
- padding
- margin
- space inside the border
- False
- 272
- border
- 108
- True
- True
- the line round the box
- 196
- 186
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids