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 gap to other boxes? (a) border (b) padding (c) margin (d) content
- 2.📦 In the box model, which part is a solid or dotted edge? (a) border (b) padding (c) margin (d) content
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 4.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
- 5.True or false: the border is the text or picture. (a) False (b) True
- 6.Which of these is padding? (a) the line round the box (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} - 10.True or false: padding is space outside the border. (a) False (b) True
- 11.Which of these is the border? (a) the gap to other boxes (b) the line round the box (c) space inside the border (d) space outside the border
-
12.📦 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: 15px;
border: 5px solid black;
margin: 5px;
} - 13.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) space inside the border (d) a solid or dotted edge
- 14.Which of these is margin? (a) a solid or dotted edge (b) space outside the border (c) space inside the border (d) the text or picture
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 5px 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: 50px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
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: 5px solid black;
margin: 5px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} - 21.Which of these is the content? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 22.True or false: margin is the text or picture. (a) True (b) False
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 24.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) content (d) padding
-
25.📦 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: 1px solid black;
margin: 5px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 27.True or false: the content is the text or picture. (a) False (b) True
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} - 29.📦 In the box model, which part is the gap round content? (a) content (b) border (c) margin (d) padding
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
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: 250px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 33.True or false: the content is the gap round content. (a) True (b) False
- 34.True or false: padding is space inside the border. (a) True (b) False
-
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 300px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 36.True or false: margin is space inside the border. (a) False (b) True
-
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
40.📦 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: 25px;
border: 5px solid black;
margin: 0px;
}
Answer key
- margin
- border
- 322
- padding
- False
- the gap round content
- 288
- 244
- 172
- False
- the line round the box
- 140
- space inside the border
- space outside the border
- 180
- 82
- 180
- 262
- 94
- 330
- the text or picture
- False
- 92
- margin
- 302
- 112
- True
- 74
- padding
- 364
- 278
- 116
- False
- True
- 334
- False
- 246
- 168
- 272
- 160
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids