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: the border is the line round the box. (a) True (b) False
- 2.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) content (d) padding
- 3.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) content (d) margin
- 4.True or false: padding 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: 70px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 6.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 7.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) space inside the border (d) the line round the box
-
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: 270px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 9.True or false: margin is the gap to other boxes. (a) False (b) True
-
10.📦 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: 5px solid black;
margin: 5px;
} - 11.Which of these is padding? (a) the gap to other boxes (b) a solid or dotted edge (c) space inside the border (d) the text or picture
-
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: 300px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 13.True or false: padding is the gap round content. (a) True (b) False
-
14.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 160px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 15.Which of these is the content? (a) the text or picture (b) the gap to other boxes (c) space inside the border (d) the line round the box
- 16.True or false: the border is a solid or dotted edge. (a) True (b) False
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} - 19.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) space inside the border (d) space outside the border
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
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: 80px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} - 22.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) border (d) content
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
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: 220px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
28.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 180px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
29.📦 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: 4px solid black;
margin: 0px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 31.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
- 32.Which of these is margin? (a) the line round the box (b) the gap round content (c) space outside the border (d) space inside the border
-
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} -
34.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 270px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
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: 290px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 38.True or false: padding is space inside the border. (a) False (b) True
-
39.📦 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: 10px;
border: 5px solid black;
margin: 5px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 5px solid black;
margin: 15px;
}
Answer key
- True
- margin
- padding
- False
- 96
- the gap to other boxes
- the line round the box
- 308
- True
- 160
- space inside the border
- 312
- True
- 198
- the text or picture
- True
- 104
- 238
- a solid or dotted edge
- 312
- 140
- border
- 108
- 332
- 170
- 234
- 274
- 210
- 138
- 236
- padding
- space outside the border
- 200
- 312
- 126
- 358
- 336
- True
- 280
- 260
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids