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: 60px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
2.📦 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;
} - 3.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) border (d) content
- 4.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) the gap to other boxes (d) the text or picture
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} - 6.📦 In the box model, which part is the gap to other boxes? (a) content (b) border (c) margin (d) padding
- 7.True or false: the border is space inside the border. (a) True (b) False
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 9.True or false: the border is a solid or dotted edge. (a) False (b) True
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
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: 230px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
13.📦 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: 20px;
border: 1px solid black;
margin: 5px;
} - 14.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) margin (d) content
- 15.📦 In the box model, which part is the line round the box? (a) margin (b) padding (c) content (d) border
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 17.True or false: padding is the text or picture. (a) False (b) True
-
18.📦 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: 25px;
border: 1px solid black;
margin: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} - 21.True or false: the border is the line round the box. (a) False (b) True
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 24.Which of these is padding? (a) space inside the border (b) space outside the border (c) the line round the box (d) the gap to other boxes
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
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: 10px;
border: 5px solid black;
margin: 0px;
} - 27.True or false: padding is the line round the box. (a) True (b) False
- 28.True or false: margin is space inside the border. (a) True (b) False
-
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: 140px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} - 31.Which of these is the content? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the text or picture
- 32.Which of these is margin? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) space inside the border
- 33.True or false: padding is the gap round content. (a) False (b) True
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 37.True or false: the content is the gap round content. (a) True (b) False
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
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: 50px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 30px;
border: 2px solid black;
margin: 0px;
}
Answer key
- 74
- 260
- content
- a solid or dotted edge
- 160
- margin
- False
- 348
- True
- 98
- 144
- 284
- 122
- margin
- border
- 154
- False
- 252
- 218
- 76
- True
- 246
- 124
- space inside the border
- 152
- 260
- False
- False
- 210
- 220
- the text or picture
- the gap to other boxes
- True
- 136
- 254
- 286
- False
- 116
- 64
- 174
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids