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.Which of these is margin? (a) the text or picture (b) the gap round content (c) a solid or dotted edge (d) space outside the border
- 2.True or false: margin is space inside the border. (a) True (b) False
- 3.Which of these is padding? (a) a solid or dotted edge (b) space inside the border (c) space outside the border (d) the gap to other boxes
- 4.True or false: padding is space inside the border. (a) False (b) True
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} - 7.True or false: padding is the gap round content. (a) False (b) True
-
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: 290px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
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: 170px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} - 12.True or false: margin is the gap to other boxes. (a) True (b) False
- 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: 110px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
15.📦 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: 2px solid black;
margin: 15px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} - 19.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
- 20.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) border (d) content
- 21.True or false: margin is space outside the border. (a) False (b) True
- 22.True or false: the border is the line round the box. (a) False (b) True
- 23.Which of these is the border? (a) the gap round content (b) the text or picture (c) a solid or dotted edge (d) space inside the border
-
24.📦 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: 3px solid black;
margin: 15px;
} - 25.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) border (d) padding
- 26.Which of these is padding? (a) space outside the border (b) the gap round content (c) the gap to other boxes (d) the line round the box
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
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: 80px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 36.True or false: the border is the gap round content. (a) False (b) True
-
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: 150px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} - 39.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
- 40.True or false: padding is space outside the border. (a) False (b) True
Answer key
- space outside the border
- False
- space inside the border
- True
- 140
- 296
- True
- 340
- 200
- 216
- 176
- True
- True
- 152
- 84
- 228
- 278
- 182
- border
- margin
- True
- True
- a solid or dotted edge
- 356
- padding
- the gap round content
- 104
- 314
- 260
- 108
- 94
- 90
- 216
- 260
- 254
- False
- 188
- 144
- content
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids