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 outside the border? (a) border (b) padding (c) content (d) margin
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 3.True or false: margin is space outside the border. (a) True (b) False
- 4.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 6.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
- 7.True or false: the border is the line round the box. (a) False (b) True
- 8.Which of these is the content? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) the text or picture
-
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 11.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} - 13.Which of these is margin? (a) the gap to other boxes (b) space inside the border (c) the gap round content (d) the line round the box
- 14.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 3px 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: 250px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
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: 50px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} - 20.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) border (d) padding
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 3px 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: 30px;
border: 1px solid black;
margin: 0px;
} -
23.📦 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: 20px;
border: 1px solid black;
margin: 10px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 25.Which of these is padding? (a) space inside the border (b) the gap to other boxes (c) space outside the border (d) the text or picture
-
26.📦 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: 0px;
} - 27.Which of these is padding? (a) the line round the box (b) the text or picture (c) a solid or dotted edge (d) the gap round content
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 29.True or false: margin is space inside the border. (a) False (b) True
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} -
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: 140px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
33.📦 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: 30px;
border: 4px solid black;
margin: 20px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
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: 250px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
37.📦 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: 10px;
border: 4px solid black;
margin: 0px;
} - 38.Which of these is margin? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the text or picture
- 39.True or false: padding is the gap round content. (a) True (b) False
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 1px solid black;
margin: 0px;
}
Answer key
- margin
- 82
- True
- padding
- 332
- padding
- True
- the text or picture
- 126
- 114
- border
- 390
- the gap to other boxes
- a solid or dotted edge
- 206
- 314
- 124
- 64
- 116
- border
- 206
- 112
- 312
- 244
- space inside the border
- 138
- the gap round content
- 242
- False
- 312
- 300
- 160
- 178
- 118
- 102
- 296
- 278
- space outside the border
- True
- 62
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids