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 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: 30px;
border: 3px solid black;
margin: 0px;
} -
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} - 3.Which of these is the content? (a) the text or picture (b) the gap to other boxes (c) the gap round content (d) the line round the box
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 5.True or false: margin is the line round the box. (a) False (b) True
- 6.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) space outside the border (d) a solid or dotted edge
- 7.True or false: margin is space outside the border. (a) True (b) False
- 8.True or false: the content is a solid or dotted edge. (a) True (b) False
- 9.True or false: the content is the gap to other boxes. (a) False (b) True
-
10.📦 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: 10px;
border: 4px solid black;
margin: 15px;
} - 11.True or false: the border is space inside the border. (a) True (b) False
- 12.True or false: padding is the text or picture. (a) True (b) False
-
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: 90px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 14.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) padding (d) border
- 15.Which of these is padding? (a) space outside the border (b) space inside the border (c) the gap to other boxes (d) the line round the box
- 16.Which of these is padding? (a) the gap to other boxes (b) a solid or dotted edge (c) space outside the border (d) the gap round content
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 18.Which of these is margin? (a) the gap round content (b) space inside the border (c) the gap to other boxes (d) the line round the box
- 19.Which of these is the border? (a) space outside the border (b) the gap round content (c) the line round the box (d) the gap to other boxes
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 5px 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: 50px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} - 23.True or false: padding is space inside the border. (a) True (b) False
- 24.📦 In the box model, which part is space outside the border? (a) padding (b) border (c) margin (d) content
-
25.📦 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: 20px;
} -
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: 70px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
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: 100px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} - 29.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the line round the box (d) space outside the border
-
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: 270px;
padding: 10px;
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: 70px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} - 33.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) border (d) padding
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
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: 90px;
padding: 30px;
border: 1px 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: 120px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 5px;
border: 5px solid black;
margin: 10px;
}
Answer key
- 246
- 214
- the text or picture
- 396
- False
- a solid or dotted edge
- True
- False
- False
- 318
- False
- False
- 144
- padding
- space inside the border
- the gap round content
- 266
- the gap to other boxes
- the line round the box
- 324
- 310
- 72
- True
- margin
- 260
- 134
- 130
- 108
- space outside the border
- 300
- 96
- 256
- border
- 160
- 152
- 128
- 212
- 152
- 142
- 300
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids