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 across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
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: 150px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 4.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) content (d) margin
-
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: 100px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} - 6.Which of these is the content? (a) the line round the box (b) the gap to other boxes (c) the text or picture (d) space outside the border
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
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: 120px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 10.📦 In the box model, which part is the gap round content? (a) margin (b) padding (c) border (d) content
-
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} - 12.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the gap to other boxes (d) the line round the box
- 13.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) content (d) border
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 15.True or false: the border is a solid or dotted edge. (a) True (b) False
- 16.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) margin (d) content
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 23.Which of these is padding? (a) the line round the box (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
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: 280px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 25.True or false: margin is the gap round content. (a) False (b) True
-
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} - 27.True or false: the border is space inside the border. (a) False (b) True
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 32.Which of these is margin? (a) the gap round content (b) a solid or dotted edge (c) space outside the border (d) the text or picture
- 33.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) the line round the box (d) space outside the border
- 34.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) the text or picture
- 35.True or false: margin is the gap to other boxes. (a) True (b) False
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} - 39.True or false: padding is the gap round content. (a) True (b) False
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 15px;
border: 4px solid black;
margin: 10px;
}
Answer key
- 224
- 270
- 172
- content
- 140
- the text or picture
- 110
- 184
- 254
- padding
- 316
- the gap to other boxes
- border
- 262
- True
- border
- 298
- 126
- 328
- 122
- 322
- 98
- space inside the border
- 338
- False
- 228
- False
- 220
- 126
- 162
- 308
- space outside the border
- the gap round content
- a solid or dotted edge
- True
- 140
- 226
- 192
- True
- 188
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids