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 across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 20px;
border: 1px solid black;
margin: 20px;
} -
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 3.True or false: padding is space inside the border. (a) True (b) False
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 5.📦 In the box model, which part is the gap round content? (a) padding (b) content (c) border (d) margin
- 6.Which of these is the border? (a) space inside the border (b) space outside the border (c) the gap to other boxes (d) the line round the box
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 8.📦 In the box model, which part is a solid or dotted edge? (a) border (b) padding (c) content (d) margin
- 9.Which of these is the content? (a) space outside the border (b) space inside the border (c) the gap to other boxes (d) the text or picture
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} - 11.True or false: margin is space outside the border. (a) False (b) True
- 12.True or false: the content is the text or picture. (a) False (b) True
- 13.True or false: the border is the gap round content. (a) False (b) True
-
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: 290px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 16.True or false: the border is a solid or dotted edge. (a) True (b) False
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} -
19.📦 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: 3px solid black;
margin: 5px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} - 21.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) content (d) margin
- 22.📦 In the box model, which part is the gap to other boxes? (a) padding (b) border (c) margin (d) content
-
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: 230px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 24.Which of these is margin? (a) the line round the box (b) the gap round content (c) the gap to other boxes (d) the text or picture
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} - 26.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) the line round the box (d) a solid or dotted edge
- 27.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
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: 50px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 29.Which of these is the border? (a) the gap round content (b) space inside the border (c) space outside the border (d) a solid or dotted edge
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 35.True or false: padding is the gap round content. (a) True (b) False
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 40.True or false: margin is the gap to other boxes. (a) False (b) True
Answer key
- 342
- 232
- True
- 304
- padding
- the line round the box
- 168
- border
- the text or picture
- 192
- True
- True
- False
- 304
- 248
- True
- 238
- 146
- 236
- 108
- padding
- margin
- 266
- the gap to other boxes
- 320
- the gap round content
- content
- 82
- a solid or dotted edge
- 130
- 98
- 262
- 316
- 200
- True
- 350
- 122
- 188
- 196
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids