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.True or false: padding is space outside the border. (a) True (b) False
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 3.📦 In the box model, which part is the gap round content? (a) content (b) border (c) margin (d) padding
- 4.Which of these is the content? (a) the line round the box (b) the text or picture (c) a solid or dotted edge (d) the gap to other boxes
- 5.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
- 6.📦 In the box model, which part is space inside the border? (a) content (b) border (c) margin (d) padding
- 7.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 9.Which of these is margin? (a) the line round the box (b) space outside the border (c) the gap round content (d) the text or picture
- 10.True or false: margin is the gap to other boxes. (a) False (b) True
- 11.📦 In the box model, which part is the text or picture? (a) padding (b) content (c) margin (d) border
-
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: 240px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 13.True or false: the border is the text or picture. (a) True (b) False
- 14.📦 In the box model, which part is the gap to other boxes? (a) margin (b) content (c) border (d) padding
- 15.True or false: the border is the line round the box. (a) False (b) True
- 16.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) a solid or dotted edge (d) the line round the box
-
17.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 230px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} - 19.True or false: padding is the gap round content. (a) False (b) True
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 21.Which of these is the border? (a) the gap round content (b) space outside the border (c) the text or picture (d) the line round the box
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 24.True or false: padding is the line round the box. (a) False (b) True
-
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: 240px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} - 26.Which of these is the border? (a) space outside the border (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 30.True or false: padding is space inside the border. (a) True (b) False
-
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: 240px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} - 37.True or false: the border is a solid or dotted edge. (a) True (b) False
-
38.📦 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: 20px;
border: 2px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 1px 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: 260px;
padding: 10px;
border: 4px solid black;
margin: 0px;
}
Answer key
- False
- 176
- padding
- the text or picture
- margin
- padding
- border
- 162
- space outside the border
- True
- content
- 288
- False
- margin
- True
- the gap round content
- 262
- 288
- True
- 284
- the line round the box
- 106
- 146
- False
- 290
- a solid or dotted edge
- 198
- 204
- 134
- True
- 284
- 182
- 224
- 176
- 134
- 148
- True
- 164
- 272
- 288
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids