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) margin (b) border (c) padding (d) content
- 2.Which of these is padding? (a) space outside the border (b) the gap round content (c) the gap to other boxes (d) the text or picture
- 3.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
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: 220px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 6.True or false: margin is the gap to other boxes. (a) True (b) False
- 7.True or false: the border is the line round the box. (a) False (b) True
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 9.True or false: the border is the gap to other boxes. (a) True (b) False
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 11.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) border (d) padding
- 12.Which of these is the content? (a) the line round the box (b) the text or picture (c) a solid or dotted edge (d) the gap round content
- 13.📦 In the box model, which part is space outside the border? (a) padding (b) margin (c) content (d) border
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 15.True or false: margin is the line round the box. (a) False (b) True
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 17.True or false: padding is a solid or dotted edge. (a) False (b) True
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 25.📦 In the box model, which part is the gap to other boxes? (a) content (b) border (c) padding (d) margin
- 26.True or false: the content is the line round the box. (a) False (b) True
- 27.📦 In the box model, which part is the gap round content? (a) content (b) border (c) margin (d) padding
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
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: 50px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 30.True or false: padding is space inside the border. (a) True (b) False
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} - 32.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) the gap round content (d) the line round the box
- 33.True or false: margin is space inside the border. (a) False (b) True
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
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: 5px;
} -
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: 190px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
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: 100px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 39.True or false: margin is space outside the border. (a) False (b) True
-
40.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 300px;
padding: 10px;
border: 5px solid black;
margin: 15px;
}
Answer key
- border
- the gap round content
- padding
- 142
- 260
- True
- True
- 192
- False
- 176
- content
- the text or picture
- margin
- 78
- False
- 100
- False
- 144
- 286
- 214
- 134
- 260
- 168
- 194
- margin
- False
- padding
- 200
- 64
- True
- 190
- the line round the box
- False
- 166
- 136
- 116
- 218
- 128
- True
- 330
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids