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 text or picture? (a) margin (b) border (c) content (d) padding
- 2.True or false: the content is the text or picture. (a) True (b) False
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} - 4.📦 In the box model, which part is space inside the border? (a) content (b) border (c) margin (d) padding
-
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: 270px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 6.True or false: padding is the gap to other boxes. (a) False (b) True
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 8.Which of these is padding? (a) the gap to other boxes (b) space inside the border (c) the line round the box (d) space outside the border
- 9.Which of these is padding? (a) the line round the box (b) the gap to other boxes (c) a solid or dotted edge (d) the gap round content
- 10.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) the line round the box (d) the gap to other boxes
- 11.Which of these is the content? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) space outside the border
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} -
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: 110px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 14.Which of these is margin? (a) the line round the box (b) space outside the border (c) the gap round content (d) a solid or dotted edge
- 15.True or false: margin is the gap to other boxes. (a) True (b) False
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
18.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 150px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 20.📦 In the box model, which part is the gap round content? (a) border (b) content (c) margin (d) padding
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} -
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: 120px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 24.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) border (d) padding
- 25.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) border (d) margin
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} - 27.📦 In the box model, which part is the gap to other boxes? (a) content (b) border (c) margin (d) padding
- 28.Which of these is the border? (a) the line round the box (b) space outside the border (c) the gap to other boxes (d) the gap round content
-
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: 120px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
33.📦 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: 15px;
border: 1px solid black;
margin: 0px;
} - 34.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the gap round content (d) space outside the border
- 35.True or false: the border is the gap round content. (a) True (b) False
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 38.📦 In the box model, which part is space outside the border? (a) padding (b) margin (c) content (d) border
-
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: 210px;
padding: 20px;
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: 290px;
padding: 15px;
border: 2px solid black;
margin: 15px;
}
Answer key
- content
- True
- 132
- padding
- 308
- False
- 118
- space inside the border
- the gap round content
- the gap to other boxes
- the text or picture
- 298
- 132
- space outside the border
- True
- 236
- 308
- 176
- 214
- padding
- 248
- 176
- 326
- border
- border
- 180
- margin
- the line round the box
- 132
- 192
- 224
- 174
- 102
- a solid or dotted edge
- False
- 198
- 250
- margin
- 254
- 324
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids