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 padding? (a) the gap to other boxes (b) space inside the border (c) space outside the border (d) a solid or dotted edge
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} -
3.📦 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: 5px;
border: 1px solid black;
margin: 15px;
} - 4.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) space outside the border (d) space inside the border
- 5.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) padding (d) border
- 6.True or false: padding is space inside the border. (a) False (b) True
-
7.📦 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: 10px;
border: 5px solid black;
margin: 15px;
} - 8.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) margin (d) border
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 10.True or false: the border is the line round the box. (a) False (b) True
-
11.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 130px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} - 12.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) margin (d) border
- 13.True or false: margin is the text or picture. (a) True (b) False
- 14.Which of these is margin? (a) space inside the border (b) the line round the box (c) the gap to other boxes (d) a solid or dotted edge
- 15.Which of these is the border? (a) the text or picture (b) the gap round content (c) space inside the border (d) the line round the box
-
16.📦 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: 30px;
border: 4px solid black;
margin: 20px;
} - 17.Which of these is the border? (a) the text or picture (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
- 18.Which of these is the content? (a) a solid or dotted edge (b) the text or picture (c) the gap to other boxes (d) the gap round content
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} -
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: 170px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} -
22.📦 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: 20px;
border: 1px solid black;
margin: 15px;
} - 23.True or false: margin is space outside the border. (a) False (b) True
- 24.True or false: the border is a solid or dotted edge. (a) True (b) False
- 25.True or false: the border is the text or picture. (a) True (b) False
-
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: 260px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} - 28.📦 In the box model, which part is the text or picture? (a) content (b) margin (c) border (d) padding
- 29.True or false: padding is the gap round content. (a) False (b) True
-
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: 120px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
31.📦 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: 3px solid black;
margin: 10px;
} - 32.True or false: margin is a solid or dotted edge. (a) False (b) True
-
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} - 34.Which of these is padding? (a) the line round the box (b) space outside the border (c) the text or picture (d) the gap round content
- 35.True or false: the border is the gap to other boxes. (a) False (b) True
-
36.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 90px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
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: 90px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 38.True or false: margin is the gap to other boxes. (a) True (b) False
- 39.True or false: padding is space outside the border. (a) True (b) False
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 10px;
border: 3px solid black;
margin: 20px;
}
Answer key
- space inside the border
- 190
- 212
- space outside the border
- border
- True
- 230
- border
- 170
- True
- 150
- margin
- False
- the gap to other boxes
- the line round the box
- 298
- a solid or dotted edge
- the text or picture
- 262
- 248
- 238
- 202
- True
- True
- False
- 316
- 190
- content
- True
- 140
- 286
- False
- 196
- the gap round content
- False
- 110
- 104
- True
- False
- 346
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids