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) border (b) padding (c) margin (d) content
- 2.True or false: padding is the gap to other boxes. (a) False (b) True
- 3.Which of these is margin? (a) space inside the border (b) the text or picture (c) the gap round content (d) the gap to other boxes
- 4.True or false: margin is the text or picture. (a) True (b) False
- 5.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
- 6.Which of these is padding? (a) the gap round content (b) space outside the border (c) the line round the box (d) a solid or dotted edge
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
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: 60px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 9.Which of these is padding? (a) the line round the box (b) space outside the border (c) a solid or dotted edge (d) space inside the border
- 10.True or false: padding is the line round the box. (a) True (b) False
- 11.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) border (d) padding
- 12.Which of these is the content? (a) space inside the border (b) the line round the box (c) the text or picture (d) space outside the border
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 14.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) padding (d) border
- 15.📦 In the box model, which part is the gap to other boxes? (a) margin (b) padding (c) border (d) content
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} -
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 19.Which of these is margin? (a) the text or picture (b) the line round the box (c) a solid or dotted edge (d) space outside the border
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 21.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) space outside the border (d) the gap round content
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} -
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: 100px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 24.Which of these is the border? (a) the text or picture (b) the gap to other boxes (c) the line round the box (d) the gap round content
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} - 28.True or false: margin is the line round the box. (a) True (b) False
- 29.True or false: the border is a solid or dotted edge. (a) False (b) True
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 31.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) margin (d) content
- 32.True or false: the border is space outside the border. (a) True (b) False
- 33.True or false: margin is the gap round content. (a) True (b) False
- 34.True or false: margin is space inside the border. (a) True (b) False
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 39.True or false: the border is the text or picture. (a) True (b) False
- 40.True or false: padding is the gap round content. (a) False (b) True
Answer key
- padding
- False
- the gap to other boxes
- False
- border
- the gap round content
- 338
- 88
- space inside the border
- False
- padding
- the text or picture
- 272
- content
- margin
- 194
- 214
- 226
- space outside the border
- 174
- a solid or dotted edge
- 216
- 166
- the line round the box
- 248
- 232
- 250
- False
- True
- 116
- margin
- False
- False
- False
- 156
- 134
- 238
- 184
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids