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.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 2.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) margin (d) padding
-
3.📦 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: 10px;
border: 5px solid black;
margin: 20px;
} - 4.Which of these is the content? (a) the gap to other boxes (b) space outside the border (c) the line round the box (d) the text or picture
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 6.Which of these is the border? (a) the gap round content (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
-
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.📦 In the box model, which part is the text or picture? (a) content (b) border (c) padding (d) margin
- 9.True or false: the border is space outside the border. (a) False (b) True
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} - 12.True or false: the content is the gap round content. (a) True (b) False
- 13.True or false: padding is space inside the border. (a) False (b) True
-
14.📦 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: 30px;
border: 1px solid black;
margin: 20px;
} - 15.Which of these is padding? (a) the line round the box (b) space outside the border (c) the gap round content (d) the gap to other boxes
- 16.True or false: the border is the line round the box. (a) False (b) True
- 17.True or false: margin is the text or picture. (a) True (b) False
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
19.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} - 20.📦 In the box model, which part is a solid or dotted edge? (a) border (b) margin (c) padding (d) content
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 22.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) margin (d) border
- 23.True or false: padding is space outside the border. (a) True (b) False
- 24.True or false: margin is the line round the box. (a) True (b) False
- 25.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
27.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 180px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 28.Which of these is padding? (a) the gap to other boxes (b) space inside the border (c) the text or picture (d) space outside the border
-
29.📦 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: 20px;
border: 5px solid black;
margin: 0px;
} - 30.True or false: the border is a solid or dotted edge. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} - 33.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
-
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: 170px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 36.True or false: the content is the gap to other boxes. (a) True (b) False
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} - 38.Which of these is the border? (a) the line round the box (b) space outside the border (c) space inside the border (d) the gap to other boxes
- 39.True or false: the border is space inside the border. (a) True (b) False
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 3px solid black;
margin: 20px;
}
Answer key
- 176
- margin
- 170
- the text or picture
- 264
- a solid or dotted edge
- 194
- content
- False
- 84
- 76
- False
- True
- 302
- the gap round content
- True
- False
- 132
- 182
- border
- 352
- padding
- False
- False
- the gap to other boxes
- 204
- 202
- space inside the border
- 190
- True
- 242
- 230
- margin
- 236
- 184
- False
- 150
- the line round the box
- False
- 116
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids