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 space inside the border? (a) margin (b) border (c) content (d) padding
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
3.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 4.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) border (d) margin
- 5.True or false: padding is space inside the border. (a) False (b) True
-
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: 190px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 7.Which of these is padding? (a) space outside the border (b) the line round the box (c) the gap round content (d) a solid or dotted edge
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
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: 230px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 10.True or false: margin is space outside the border. (a) False (b) True
- 11.True or false: the border is the line round the box. (a) False (b) True
-
12.📦 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: 5px;
border: 3px solid black;
margin: 5px;
} -
13.📦 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: 20px;
} - 14.Which of these is padding? (a) space outside the border (b) space inside the border (c) the line round the box (d) the text or picture
- 15.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) margin (d) content
- 16.Which of these is margin? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the text or picture
-
17.📦 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;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 21.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
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: 50px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} - 24.True or false: padding is the text or picture. (a) False (b) True
- 25.True or false: the content is the text or picture. (a) True (b) False
-
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 27.Which of these is the border? (a) space outside the border (b) the gap round content (c) space inside the border (d) the line round the box
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 15px;
border: 2px 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: 110px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 33.True or false: padding is space outside the border. (a) True (b) False
- 34.True or false: the border is the gap round content. (a) False (b) True
- 35.True or false: padding is the gap round content. (a) False (b) True
- 36.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) margin (d) border
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 4px 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: 210px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 20px;
border: 4px solid black;
margin: 5px;
}
Answer key
- padding
- 134
- 96
- margin
- True
- 248
- the gap round content
- 170
- 282
- True
- True
- 286
- 216
- space inside the border
- border
- the gap to other boxes
- 62
- 362
- 284
- 152
- border
- 96
- 72
- False
- True
- 174
- the line round the box
- 308
- 180
- 244
- 150
- 184
- False
- False
- True
- padding
- 368
- 232
- 130
- 188
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids