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.True or false: margin is the gap to other boxes. (a) False (b) True
- 2.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
- 3.Which of these is padding? (a) the text or picture (b) the gap to other boxes (c) the line round the box (d) the gap round content
- 4.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) content (d) border
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
6.📦 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: 15px;
border: 1px solid black;
margin: 10px;
} - 7.True or false: padding is space inside the border. (a) False (b) True
- 8.True or false: margin is space outside the border. (a) True (b) False
-
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: 300px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 11.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) border (d) padding
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 13.Which of these is padding? (a) space inside the border (b) space outside the border (c) the text or picture (d) the gap to other boxes
- 14.True or false: the border is a solid or dotted edge. (a) True (b) False
- 15.Which of these is margin? (a) the line round the box (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
- 16.Which of these is the content? (a) the text or picture (b) space inside the border (c) space outside the border (d) the gap to other boxes
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 18.True or false: margin is the text or picture. (a) False (b) True
- 19.True or false: the content is the text or picture. (a) True (b) False
- 20.True or false: padding is space outside the border. (a) True (b) False
-
21.📦 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: 25px;
border: 2px solid black;
margin: 20px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} - 26.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) the line round the box (d) the gap round content
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 28.True or false: margin is space inside the border. (a) True (b) False
- 29.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
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: 110px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 33.📦 In the box model, which part is the text or picture? (a) border (b) content (c) padding (d) margin
- 34.Which of these is the border? (a) the gap to other boxes (b) a solid or dotted edge (c) space inside the border (d) the gap round content
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} - 37.True or false: the content is the line round the box. (a) True (b) False
-
38.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 39.True or false: the content is the gap round content. (a) False (b) True
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 25px;
border: 5px solid black;
margin: 0px;
}
Answer key
- True
- border
- the gap round content
- border
- 338
- 112
- True
- True
- 352
- 204
- margin
- 170
- space inside the border
- True
- the gap to other boxes
- the text or picture
- 232
- False
- True
- False
- 294
- 204
- 168
- 154
- 84
- the line round the box
- 68
- False
- padding
- 292
- 238
- 138
- content
- a solid or dotted edge
- 220
- 230
- False
- 254
- False
- 130
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids