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) padding (b) margin (c) content (d) border
- 2.📦 In the box model, which part is the line round the box? (a) content (b) border (c) margin (d) padding
- 3.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) space outside the border (d) space inside the border
- 4.Which of these is the border? (a) the line round the box (b) space inside the border (c) the gap round content (d) the gap to other boxes
- 5.True or false: the content is the text or picture. (a) False (b) True
- 6.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) space outside the border (d) the gap round content
- 7.True or false: padding is space outside the border. (a) True (b) False
-
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: 190px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} - 11.📦 In the box model, which part is space inside the border? (a) content (b) border (c) margin (d) padding
- 12.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 15.True or false: padding is the gap round content. (a) False (b) True
-
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: 280px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 18.Which of these is margin? (a) the text or picture (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
- 19.True or false: padding is space inside the border. (a) True (b) False
- 20.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
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: 140px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 24.True or false: margin is the gap round content. (a) True (b) False
- 25.True or false: margin is space outside the border. (a) False (b) True
- 26.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) border (d) margin
- 27.True or false: the content is space outside the border. (a) False (b) True
- 28.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
- 29.Which of these is the content? (a) the text or picture (b) the gap round content (c) space outside the border (d) the line round the box
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 31.True or false: the content is the gap round content. (a) True (b) False
-
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
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: 200px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 40.True or false: padding is a solid or dotted edge. (a) False (b) True
Answer key
- padding
- border
- space outside the border
- the line round the box
- True
- the gap round content
- False
- 218
- 174
- 204
- padding
- border
- 106
- 250
- True
- 346
- 222
- the gap to other boxes
- True
- margin
- 96
- 182
- 158
- False
- True
- margin
- False
- content
- the text or picture
- 166
- False
- 124
- 342
- 178
- 276
- 156
- 226
- 180
- 234
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids