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: 300px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} - 2.True or false: margin is space inside the border. (a) False (b) True
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 4.Which of these is padding? (a) the gap to other boxes (b) the line round the box (c) space outside the border (d) space inside the border
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 7.True or false: margin is space outside the border. (a) False (b) True
- 8.True or false: padding is the gap to other boxes. (a) False (b) True
- 9.📦 In the box model, which part is space inside the border? (a) margin (b) padding (c) border (d) content
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 12.True or false: the border is the line round the box. (a) False (b) True
- 13.True or false: the border is a solid or dotted edge. (a) False (b) True
- 14.True or false: padding is the line round the box. (a) False (b) True
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} - 16.Which of these is margin? (a) the gap to other boxes (b) space inside the border (c) the gap round content (d) the text or picture
-
17.📦 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;
} -
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: 110px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 19.True or false: the content is the text or picture. (a) True (b) False
- 20.True or false: the content is space inside the border. (a) False (b) True
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 23.True or false: padding is space outside the border. (a) True (b) False
- 24.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) space outside the border
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} -
27.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 240px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 29.True or false: the border is space outside the border. (a) False (b) True
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} - 31.True or false: padding is space inside the border. (a) True (b) False
-
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: 230px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 35.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) border (d) margin
- 36.True or false: the border is space inside the border. (a) False (b) True
- 37.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) border (d) padding
-
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: 50px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 39.Which of these is padding? (a) the line round the box (b) a solid or dotted edge (c) the text or picture (d) the gap round content
- 40.📦 In the box model, which part is space outside the border? (a) content (b) border (c) padding (d) margin
Answer key
- 330
- False
- 250
- space inside the border
- 214
- 228
- True
- False
- padding
- 238
- 296
- True
- True
- False
- 230
- the gap to other boxes
- 62
- 126
- True
- False
- 106
- 168
- False
- a solid or dotted edge
- 216
- 184
- 256
- 394
- False
- 124
- True
- 264
- 234
- 142
- border
- False
- content
- 116
- the gap round content
- margin
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids