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: 130px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 2.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) border (d) content
- 3.True or false: the border is the line round the box. (a) True (b) False
- 4.True or false: margin is a solid or dotted edge. (a) True (b) False
-
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: 250px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} - 6.Which of these is the content? (a) space inside the border (b) the gap round content (c) a solid or dotted edge (d) the text or picture
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
9.📦 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: 25px;
border: 1px solid black;
margin: 5px;
} - 10.Which of these is margin? (a) a solid or dotted edge (b) the gap to other boxes (c) space inside the border (d) the text or picture
- 11.True or false: padding is the line round the box. (a) True (b) False
- 12.Which of these is padding? (a) the line round the box (b) space outside the border (c) space inside the border (d) the text or picture
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 14.True or false: padding is space inside the border. (a) False (b) True
- 15.True or false: margin is space outside the border. (a) True (b) False
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 17.Which of these is margin? (a) the line round the box (b) space outside the border (c) a solid or dotted edge (d) the text or picture
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 19.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) border (d) padding
-
20.📦 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: 5px;
border: 3px solid black;
margin: 15px;
} - 21.Which of these is the border? (a) space inside the border (b) the line round the box (c) the text or picture (d) space outside the border
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
23.📦 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: 20px;
} - 24.Which of these is the border? (a) the gap round content (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
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: 230px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
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: 90px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
30.📦 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: 30px;
border: 3px solid black;
margin: 5px;
} - 31.True or false: the border is space inside the border. (a) True (b) False
-
32.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 130px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 33.True or false: the content is space inside the border. (a) False (b) True
- 34.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) padding (d) content
-
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: 220px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
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: 140px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 37.True or false: margin is space inside the border. (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: 190px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 15px;
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: 50px;
padding: 5px;
border: 3px solid black;
margin: 5px;
}
Answer key
- 178
- margin
- True
- False
- 296
- the text or picture
- 226
- 138
- 202
- the gap to other boxes
- False
- space inside the border
- 194
- True
- True
- 162
- space outside the border
- 280
- border
- 86
- the line round the box
- 82
- 104
- a solid or dotted edge
- 126
- 268
- 136
- 312
- 158
- 256
- False
- 184
- False
- margin
- 272
- 152
- False
- 260
- 142
- 66
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids