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 the line round the box? (a) padding (b) margin (c) border (d) content
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
4.📦 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: 10px;
border: 5px solid black;
margin: 0px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} - 7.Which of these is padding? (a) the gap round content (b) the line round the box (c) a solid or dotted edge (d) space outside the border
- 8.True or false: padding is the line round the box. (a) True (b) False
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 10.Which of these is margin? (a) the text or picture (b) space outside the border (c) the gap round content (d) a solid or dotted edge
- 11.True or false: padding is space outside the border. (a) True (b) False
- 12.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) margin (d) border
-
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: 150px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 14.Which of these is the content? (a) the text or picture (b) space outside the border (c) a solid or dotted edge (d) the gap to other boxes
- 15.Which of these is the border? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the text or picture
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
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: 100px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
20.📦 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: 15px;
border: 1px solid black;
margin: 20px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} -
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: 5px;
border: 3px solid black;
margin: 5px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 24.📦 In the box model, which part is the gap to other boxes? (a) margin (b) content (c) padding (d) border
- 25.True or false: padding is space inside the border. (a) False (b) True
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 28.True or false: margin is space outside the border. (a) True (b) False
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} - 30.📦 In the box model, which part is space outside the border? (a) content (b) padding (c) margin (d) border
- 31.True or false: margin is the gap round content. (a) False (b) True
-
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: 260px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} - 33.True or false: margin is space inside the border. (a) True (b) False
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 35.True or false: margin is the gap to other boxes. (a) False (b) True
- 36.Which of these is the border? (a) the gap to other boxes (b) the gap round content (c) the text or picture (d) the line round the box
- 37.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) margin (d) content
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 4px 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: 70px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} - 40.True or false: the content is space inside the border. (a) False (b) True
Answer key
- border
- 148
- 148
- 210
- 352
- 162
- the gap round content
- False
- 206
- space outside the border
- False
- border
- 186
- the text or picture
- a solid or dotted edge
- 82
- 132
- 148
- 240
- 272
- 238
- 66
- 284
- margin
- True
- 286
- 188
- True
- 238
- margin
- False
- 282
- False
- 340
- True
- the line round the box
- content
- 108
- 104
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids