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.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) margin (d) padding
- 2.Which of these is the content? (a) the text or picture (b) the line round the box (c) a solid or dotted edge (d) space outside the border
- 3.True or false: margin is the text or picture. (a) False (b) True
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 5.True or false: the content is the gap to other boxes. (a) True (b) False
- 6.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
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: 170px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} - 9.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) padding (d) border
- 10.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) margin (d) border
-
11.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 60px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} - 13.True or false: the content is a solid or dotted edge. (a) True (b) False
- 14.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) content (d) margin
- 15.True or false: margin is the gap to other boxes. (a) False (b) True
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} - 18.True or false: margin is the gap round content. (a) False (b) True
- 19.Which of these is the border? (a) the line round the box (b) space outside the border (c) space inside the border (d) the gap to other boxes
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 23.True or false: the content is space inside the border. (a) True (b) False
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 5px 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: 90px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} - 28.True or false: the border is the line round the box. (a) True (b) False
- 29.True or false: padding is space inside the border. (a) False (b) True
- 30.True or false: margin is space outside the border. (a) True (b) False
- 31.Which of these is margin? (a) the gap to other boxes (b) the text or picture (c) a solid or dotted edge (d) the gap round content
- 32.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) content (d) margin
- 33.True or false: padding is the gap round content. (a) True (b) False
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
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: 2px solid black;
margin: 5px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 5px solid black;
margin: 10px;
}
Answer key
- margin
- the text or picture
- False
- 148
- False
- content
- 158
- 232
- margin
- padding
- 78
- 142
- False
- border
- True
- 152
- 212
- False
- the line round the box
- 366
- 158
- 148
- False
- 86
- 170
- 110
- 346
- True
- True
- True
- the gap to other boxes
- border
- True
- 308
- 206
- 154
- 160
- 166
- 198
- 190
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids