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 round content. (a) True (b) False
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 3.True or false: padding is space inside the border. (a) True (b) False
- 4.Which of these is the content? (a) a solid or dotted edge (b) the text or picture (c) space inside the border (d) the line round the box
- 5.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) content (d) margin
- 6.True or false: padding is space outside the border. (a) False (b) True
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 8.True or false: margin is the line round the box. (a) False (b) True
- 9.True or false: the content is the text or picture. (a) True (b) False
- 10.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) border (d) margin
- 11.True or false: padding is the text or picture. (a) False (b) True
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 14.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
-
15.📦 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: 1px solid black;
margin: 10px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 17.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) content (c) border (d) padding
- 18.Which of these is margin? (a) space outside the border (b) space inside the border (c) the text or picture (d) the line round the box
- 19.True or false: margin is space inside the border. (a) True (b) False
-
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: 60px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 21.True or false: the border is a solid or dotted edge. (a) False (b) True
- 22.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
-
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} - 25.True or false: the content is space outside the border. (a) False (b) True
-
26.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 210px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 27.Which of these is padding? (a) the gap round content (b) the line round the box (c) space outside the border (d) the gap to other boxes
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} - 29.Which of these is padding? (a) space inside the border (b) the line round the box (c) the text or picture (d) the gap to other boxes
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
33.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 120px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 35.Which of these is margin? (a) the line round the box (b) the gap round content (c) the gap to other boxes (d) space inside the border
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 37.True or false: padding is the gap round content. (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: 140px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 1px solid black;
margin: 10px;
}
Answer key
- False
- 134
- True
- the text or picture
- padding
- False
- 194
- False
- True
- margin
- False
- 316
- 154
- content
- 292
- 212
- border
- space outside the border
- False
- 96
- True
- padding
- 106
- 128
- False
- 276
- the gap round content
- 156
- space inside the border
- 112
- 248
- 196
- 132
- 302
- the gap to other boxes
- 322
- True
- 154
- 220
- 172
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids