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.Which of these is the content? (a) space inside the border (b) the text or picture (c) the line round the box (d) a solid or dotted edge
- 2.📦 In the box model, which part is the text or picture? (a) padding (b) content (c) margin (d) border
- 3.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
- 4.Which of these is the border? (a) space outside the border (b) space inside the border (c) the text or picture (d) a solid or dotted edge
- 5.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) the gap to other boxes (d) space inside the border
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 7.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) padding (d) margin
-
8.📦 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: 30px;
border: 3px solid black;
margin: 20px;
} -
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: 80px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} - 11.📦 In the box model, which part is space inside the border? (a) border (b) content (c) padding (d) margin
- 12.True or false: the border is the gap round content. (a) False (b) True
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 14.True or false: the border is a solid or dotted edge. (a) True (b) False
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
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: 100px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 17.True or false: margin is a solid or dotted edge. (a) False (b) True
- 18.📦 In the box model, which part is the gap round content? (a) content (b) border (c) margin (d) padding
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
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: 50px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} - 22.True or false: margin is the gap round content. (a) True (b) False
-
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: 110px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 24.True or false: the content is space inside the border. (a) True (b) False
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 26.True or false: padding is space outside the border. (a) True (b) False
- 27.True or false: the content is space outside the border. (a) True (b) False
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} - 29.Which of these is margin? (a) space inside the border (b) the text or picture (c) the gap round content (d) space outside the border
-
30.📦 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: 30px;
border: 1px solid black;
margin: 0px;
} - 31.📦 In the box model, which part is the line round the box? (a) margin (b) border (c) content (d) padding
-
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: 200px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 33.True or false: padding is space inside the border. (a) True (b) False
-
34.📦 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: 10px;
border: 5px solid black;
margin: 15px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
36.📦 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;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 38.Which of these is padding? (a) the gap to other boxes (b) space outside the border (c) the line round the box (d) the gap round content
- 39.True or false: the border is the text or picture. (a) True (b) False
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 4px solid black;
margin: 0px;
}
Answer key
- the text or picture
- content
- margin
- a solid or dotted edge
- space inside the border
- 274
- border
- 206
- 120
- 236
- padding
- False
- 94
- True
- 160
- 114
- False
- padding
- 222
- 66
- 174
- False
- 178
- False
- 238
- False
- False
- 144
- space outside the border
- 362
- border
- 218
- True
- 130
- 138
- 62
- 114
- the gap round content
- False
- 348
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids