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 much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} - 2.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) content (d) margin
- 3.Which of these is padding? (a) space inside the border (b) the gap to other boxes (c) a solid or dotted edge (d) the text or picture
- 4.True or false: the content is space inside the border. (a) False (b) True
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} - 7.True or false: the border is the line round the box. (a) False (b) True
-
8.📦 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: 5px;
border: 1px solid black;
margin: 5px;
} - 9.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
-
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 11.True or false: the border is a solid or dotted edge. (a) False (b) True
- 12.Which of these is the content? (a) space outside the border (b) the text or picture (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: 220px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} -
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 16.True or false: the content is the text or picture. (a) True (b) False
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 18.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) space outside the border (d) the line round the box
- 19.True or false: margin is space outside the border. (a) True (b) False
- 20.True or false: margin is the gap to other boxes. (a) True (b) False
- 21.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) margin (d) border
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} - 23.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) content (d) margin
- 24.Which of these is margin? (a) the gap to other boxes (b) the gap round content (c) the line round the box (d) the text or picture
-
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: 50px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
26.📦 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: 5px;
border: 5px solid black;
margin: 20px;
} - 27.Which of these is padding? (a) the text or picture (b) the gap to other boxes (c) the gap round content (d) space outside the border
- 28.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 30.True or false: the border is the gap round content. (a) False (b) True
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 32.True or false: padding is the gap round content. (a) True (b) False
-
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: 80px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 100px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
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: 250px;
padding: 15px;
border: 5px solid black;
margin: 15px;
}
Answer key
- 224
- margin
- space inside the border
- False
- 216
- 206
- True
- 122
- border
- 110
- True
- the text or picture
- 250
- 178
- 120
- True
- 134
- the line round the box
- True
- True
- padding
- 146
- padding
- the gap to other boxes
- 64
- 170
- the gap round content
- a solid or dotted edge
- 200
- False
- 242
- True
- 94
- 154
- 136
- 212
- 242
- 158
- 292
- 290
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids