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 inside the border. (a) False (b) True
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} -
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: 120px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 25px;
border: 5px 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: 10px;
border: 4px solid black;
margin: 20px;
} - 7.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) padding (d) border
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} - 9.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) border (d) padding
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 13.True or false: margin is space outside the border. (a) False (b) True
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} - 15.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) padding (d) content
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
21.📦 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: 15px;
} - 22.True or false: margin is space inside the border. (a) True (b) False
-
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: 110px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 24.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} - 26.True or false: the border is the line round the box. (a) False (b) True
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 2px 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: 250px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} - 30.Which of these is margin? (a) the line round the box (b) space inside the border (c) a solid or dotted edge (d) space outside the border
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 32.True or false: padding is the gap round content. (a) False (b) True
- 33.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) border (d) margin
- 34.True or false: the border is space inside the border. (a) False (b) True
- 35.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} - 37.Which of these is padding? (a) the line round the box (b) space outside the border (c) the gap round content (d) the gap to other boxes
-
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: 280px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
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: 60px;
padding: 15px;
border: 4px solid black;
margin: 0px;
}
Answer key
- True
- 256
- 190
- 248
- 360
- 208
- border
- 170
- margin
- 180
- 152
- 348
- True
- 214
- margin
- 244
- 238
- 160
- 250
- 294
- 168
- False
- 142
- padding
- 162
- True
- 154
- 314
- 292
- space outside the border
- 328
- True
- padding
- False
- content
- 286
- the gap round content
- 298
- 174
- 98
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids