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: 60px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 2.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
- 3.True or false: padding is the gap to other boxes. (a) False (b) True
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
5.📦 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: 0px;
} - 6.True or false: the border is the line round the box. (a) True (b) False
- 7.Which of these is the border? (a) the text or picture (b) the line round the box (c) space outside the border (d) the gap round content
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
9.📦 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: 20px;
border: 5px solid black;
margin: 10px;
} - 10.Which of these is padding? (a) the gap round content (b) the line round the box (c) a solid or dotted edge (d) the gap to other boxes
-
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 12.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) padding (d) content
- 13.True or false: the border is the text or picture. (a) False (b) True
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
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: 140px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 19.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) padding (d) margin
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 21.Which of these is padding? (a) the line round the box (b) space outside the border (c) space inside the border (d) a solid or dotted edge
- 22.Which of these is the border? (a) space outside the border (b) space inside the border (c) the text or picture (d) a solid or dotted edge
-
23.📦 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: 0px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
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: 20px;
border: 5px solid black;
margin: 0px;
} - 27.True or false: padding is a solid or dotted edge. (a) False (b) True
- 28.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
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: 90px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
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: 80px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} - 33.Which of these is margin? (a) space inside the border (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 35.True or false: the border is the gap round content. (a) True (b) False
-
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: 120px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 37.📦 In the box model, which part is space inside the border? (a) content (b) border (c) padding (d) margin
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 39.True or false: the border is a solid or dotted edge. (a) True (b) False
- 40.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) border (d) content
Answer key
- 114
- the text or picture
- False
- 308
- 66
- True
- the line round the box
- 150
- 150
- the gap round content
- 188
- padding
- False
- 258
- 196
- 176
- 178
- 164
- border
- 308
- space inside the border
- a solid or dotted edge
- 212
- 272
- 244
- 310
- False
- margin
- 132
- 298
- 114
- 132
- the gap to other boxes
- 82
- False
- 186
- padding
- 122
- True
- content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids