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.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 200px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} - 2.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) margin (d) content
-
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: 210px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} - 5.📦 In the box model, which part is space inside the border? (a) margin (b) padding (c) border (d) content
- 6.Which of these is padding? (a) the gap round content (b) space outside the border (c) a solid or dotted edge (d) the gap to other boxes
- 7.True or false: the content is the gap to other boxes. (a) True (b) False
- 8.True or false: padding is space inside the border. (a) True (b) False
- 9.True or false: margin is the text or picture. (a) False (b) True
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 11.Which of these is margin? (a) the line round the box (b) the gap round content (c) space inside the border (d) the gap to other boxes
- 12.Which of these is padding? (a) the text or picture (b) space outside the border (c) the line round the box (d) space inside the border
-
13.📦 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: 15px;
border: 2px solid black;
margin: 20px;
} - 14.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 17.True or false: padding is the gap round content. (a) False (b) True
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 19.True or false: the content is the line round the box. (a) False (b) True
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 21.📦 In the box model, which part is the gap to other boxes? (a) padding (b) border (c) content (d) margin
- 22.True or false: padding is the line round the box. (a) False (b) True
-
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
24.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} -
25.📦 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: 20px;
border: 2px solid black;
margin: 0px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 27.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) padding (d) content
- 28.Which of these is the content? (a) the text or picture (b) the gap round content (c) a solid or dotted edge (d) space inside the border
-
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: 270px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 30.True or false: the content is the gap round content. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
32.📦 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: 20px;
border: 4px solid black;
margin: 0px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 34.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) margin (d) border
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 36.Which of these is the border? (a) the text or picture (b) the gap to other boxes (c) the line round the box (d) space inside the border
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 38.True or false: padding is space outside the border. (a) False (b) True
-
39.📦 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: 25px;
border: 1px solid black;
margin: 20px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 5px solid black;
margin: 10px;
}
Answer key
- 232
- border
- 274
- 354
- padding
- the gap round content
- False
- True
- False
- 106
- the gap to other boxes
- space inside the border
- 274
- border
- 236
- 196
- True
- 174
- False
- 204
- margin
- False
- 244
- 324
- 114
- 128
- margin
- the text or picture
- 282
- False
- 178
- 118
- 278
- padding
- 380
- the line round the box
- 122
- False
- 122
- 90
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids