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: 90px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
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: 70px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
4.📦 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: 15px;
border: 3px solid black;
margin: 10px;
} -
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 6.True or false: the border is the gap to other boxes. (a) True (b) False
- 7.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 10.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) content (d) padding
- 11.True or false: the border is the line round the box. (a) False (b) True
-
12.📦 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: 15px;
border: 2px solid black;
margin: 5px;
} - 13.True or false: the border is a solid or dotted edge. (a) False (b) True
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} - 15.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) the line round the box (d) the gap round content
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} - 20.True or false: the content is the gap round content. (a) False (b) True
-
21.📦 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: 2px solid black;
margin: 15px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 23.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) margin (c) border (d) content
- 24.Which of these is padding? (a) the text or picture (b) the line round the box (c) space outside the border (d) space inside the border
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 26.📦 In the box model, which part is the text or picture? (a) content (b) padding (c) border (d) margin
- 27.Which of these is margin? (a) the gap round content (b) the text or picture (c) the gap to other boxes (d) the line round the box
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
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: 300px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 33.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
- 34.True or false: padding is the gap round content. (a) False (b) True
-
35.📦 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: 5px;
} - 36.Which of these is the content? (a) the text or picture (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
37.📦 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: 20px;
border: 2px solid black;
margin: 10px;
} - 38.Which of these is margin? (a) the text or picture (b) the line round the box (c) space outside the border (d) the gap round content
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 40.Which of these is the border? (a) the text or picture (b) the gap round content (c) space outside the border (d) a solid or dotted edge
Answer key
- 112
- 144
- 126
- 116
- 202
- False
- border
- 178
- 298
- padding
- True
- 114
- True
- 202
- the gap round content
- 162
- 194
- 218
- 274
- False
- 104
- 124
- border
- space inside the border
- 134
- content
- the gap to other boxes
- 252
- 194
- 120
- 360
- 280
- margin
- True
- 120
- the text or picture
- 324
- space outside the border
- 170
- a solid or dotted edge
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids