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 space inside the border? (a) padding (b) border (c) content (d) margin
- 2.True or false: the content is space outside the border. (a) True (b) False
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
4.📦 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;
} -
5.📦 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: 5px;
} - 6.True or false: the content is the text or picture. (a) True (b) False
- 7.📦 In the box model, which part is space outside the border? (a) border (b) content (c) padding (d) margin
- 8.True or false: the border is the line round the box. (a) False (b) True
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 10.True or false: margin is space inside the border. (a) False (b) True
-
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} - 12.Which of these is the content? (a) the text or picture (b) a solid or dotted edge (c) the line round the box (d) the gap to other boxes
-
13.📦 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;
} - 14.True or false: margin is the gap to other boxes. (a) False (b) True
- 15.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
- 16.True or false: padding is space inside the border. (a) False (b) True
- 17.Which of these is margin? (a) the gap to other boxes (b) space inside the border (c) a solid or dotted edge (d) the gap round content
- 18.Which of these is padding? (a) the gap round content (b) a solid or dotted edge (c) space outside the border (d) the text or picture
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
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: 270px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
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: 150px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
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: 200px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} - 27.True or false: padding is the line round the box. (a) True (b) False
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 30.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) margin (d) border
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
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: 50px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 15px;
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: 250px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 36.Which of these is the border? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) space outside the border
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} - 38.True or false: padding is the gap round content. (a) False (b) True
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 40.True or false: the border is a solid or dotted edge. (a) False (b) True
Answer key
- padding
- False
- 150
- 140
- 100
- True
- margin
- True
- 230
- False
- 404
- the text or picture
- 212
- True
- border
- True
- the gap to other boxes
- the gap round content
- 334
- 324
- 226
- 236
- 166
- 192
- 262
- 166
- False
- 74
- 194
- padding
- 244
- 62
- 180
- 308
- 210
- a solid or dotted edge
- 392
- True
- 206
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids