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 round content? (a) margin (b) border (c) content (d) padding
-
2.📦 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: 15px;
border: 2px solid black;
margin: 20px;
} - 3.Which of these is the border? (a) space outside the border (b) space inside the border (c) the gap to other boxes (d) a solid or dotted edge
- 4.True or false: the border is the text or picture. (a) True (b) False
-
5.📦 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: 25px;
border: 4px solid black;
margin: 0px;
} -
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 9.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) content (d) margin
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} - 11.Which of these is margin? (a) the line round the box (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
- 12.Which of these is margin? (a) a solid or dotted edge (b) the gap round content (c) space outside the border (d) the line round the box
-
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: 270px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 14.True or false: padding is the gap round content. (a) False (b) True
- 15.Which of these is the border? (a) the gap to other boxes (b) the gap round content (c) space inside the border (d) the line round the box
- 16.📦 In the box model, which part is the text or picture? (a) margin (b) padding (c) border (d) content
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} - 19.True or false: the border is space outside the border. (a) False (b) True
-
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: 280px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} - 21.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) padding (d) border
-
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: 170px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 23.True or false: padding is space inside the border. (a) True (b) False
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 27.True or false: the content is a solid or dotted edge. (a) False (b) True
- 28.Which of these is padding? (a) the line round the box (b) space inside the border (c) the gap to other boxes (d) space outside the border
- 29.True or false: margin is the gap round content. (a) True (b) False
- 30.True or false: margin is space outside the border. (a) True (b) False
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} - 33.True or false: the content is the text or picture. (a) False (b) True
- 34.Which of these is the content? (a) the text or picture (b) space inside the border (c) the line round the box (d) a solid or dotted edge
-
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: 240px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 36.True or false: the border is the line round the box. (a) False (b) True
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 38.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) content (d) padding
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
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: 230px;
padding: 5px;
border: 2px solid black;
margin: 20px;
}
Answer key
- padding
- 294
- a solid or dotted edge
- False
- 128
- 292
- 78
- 336
- padding
- 244
- the gap to other boxes
- space outside the border
- 292
- True
- the line round the box
- content
- 166
- 90
- False
- 334
- margin
- 234
- True
- 156
- 158
- 92
- False
- space inside the border
- False
- True
- 98
- 98
- True
- the text or picture
- 262
- True
- 304
- margin
- 262
- 244
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids