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) content (b) margin (c) padding (d) border
- 2.Which of these is the content? (a) the text or picture (b) the line round the box (c) the gap round content (d) the gap to other boxes
- 3.📦 In the box model, which part is the text or picture? (a) content (b) margin (c) padding (d) border
- 4.Which of these is padding? (a) the text or picture (b) the gap round content (c) space outside the border (d) the gap to other boxes
- 5.True or false: margin is space outside the border. (a) True (b) False
-
6.📦 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: 2px solid black;
margin: 15px;
} - 7.Which of these is margin? (a) the text or picture (b) space outside the border (c) the line round the box (d) space inside the border
-
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: 160px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
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: 70px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 13.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
-
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: 180px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
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: 270px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} - 17.True or false: padding is space outside the border. (a) True (b) False
- 18.Which of these is the border? (a) a solid or dotted edge (b) the gap to other boxes (c) space inside the border (d) the gap round content
-
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: 230px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 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: the content is the line round the box. (a) True (b) False
- 22.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
- 23.True or false: margin is a solid or dotted edge. (a) True (b) False
- 24.Which of these is margin? (a) a solid or dotted edge (b) the text or picture (c) the gap to other boxes (d) space inside the border
-
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: 50px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} - 27.True or false: the content is the text or picture. (a) False (b) True
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 29.True or false: margin is the gap to other boxes. (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: 170px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} -
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: 170px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 35.True or false: the border is a solid or dotted edge. (a) False (b) True
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 37.True or false: the content is space inside the border. (a) True (b) False
-
38.📦 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: 5px;
border: 4px solid black;
margin: 0px;
} - 39.📦 In the box model, which part is space outside the border? (a) border (b) content (c) padding (d) margin
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 15px;
border: 5px solid black;
margin: 10px;
}
Answer key
- padding
- the text or picture
- content
- the gap round content
- True
- 104
- space outside the border
- 182
- 158
- 166
- 92
- 94
- border
- 198
- 244
- 286
- False
- a solid or dotted edge
- 294
- margin
- False
- border
- False
- the gap to other boxes
- 96
- 242
- True
- 204
- True
- 198
- 212
- 234
- 110
- 320
- True
- 92
- False
- 268
- margin
- 150
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids