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) padding (b) content (c) margin (d) border
- 2.True or false: margin is space outside the border. (a) True (b) False
- 3.Which of these is margin? (a) space inside the border (b) space outside the border (c) a solid or dotted edge (d) the gap round content
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} - 5.True or false: margin is the text or picture. (a) True (b) False
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 8.Which of these is the content? (a) space outside the border (b) the text or picture (c) a solid or dotted edge (d) the gap round content
-
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 10.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) padding (d) border
- 11.True or false: padding is space inside the border. (a) False (b) True
- 12.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) space inside the border (d) the gap to other boxes
- 13.Which of these is margin? (a) the text or picture (b) the gap round content (c) space inside the border (d) the gap to other boxes
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 16.📦 In the box model, which part is space inside the border? (a) border (b) margin (c) content (d) padding
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
19.📦 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: 25px;
border: 5px solid black;
margin: 5px;
} - 20.True or false: the border is a solid or dotted edge. (a) False (b) True
- 21.📦 In the box model, which part is the line round the box? (a) border (b) margin (c) padding (d) content
- 22.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) space outside the border (d) a solid or dotted edge
- 23.True or false: margin is a solid or dotted edge. (a) True (b) False
- 24.True or false: the border is the gap to other boxes. (a) False (b) True
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
27.📦 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: 2px solid black;
margin: 15px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} -
29.📦 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;
} - 30.📦 In the box model, which part is a solid or dotted edge? (a) content (b) border (c) margin (d) padding
-
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: 190px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
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: 160px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 35.True or false: margin is the gap round content. (a) True (b) False
-
36.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 5px;
border: 1px solid black;
margin: 0px;
}
Answer key
- content
- True
- space outside the border
- 270
- False
- 128
- 170
- the text or picture
- 148
- padding
- True
- space inside the border
- the gap to other boxes
- 298
- 220
- padding
- 122
- 300
- 350
- True
- border
- a solid or dotted edge
- False
- False
- 196
- 94
- 124
- 110
- 188
- border
- 222
- 276
- 172
- 202
- False
- 212
- 124
- 222
- 158
- 202
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids