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: padding is the text or picture. (a) True (b) False
- 2.Which of these is margin? (a) the line round the box (b) the text or picture (c) the gap round content (d) space outside the border
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} - 4.True or false: padding is the line round the box. (a) True (b) False
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} - 6.📦 In the box model, which part is space inside the border? (a) margin (b) border (c) padding (d) content
- 7.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
- 8.Which of these is padding? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) space outside the border
- 9.True or false: margin is space outside the border. (a) True (b) False
- 10.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) content (d) border
-
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 12.Which of these is margin? (a) the gap to other boxes (b) a solid or dotted edge (c) the line round the box (d) the text or picture
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 14.True or false: the border is a solid or dotted edge. (a) False (b) True
-
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: 160px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
18.📦 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: 15px;
border: 1px solid black;
margin: 5px;
} - 19.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the text or picture (d) the gap to other boxes
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
22.📦 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: 20px;
border: 4px solid black;
margin: 0px;
} - 23.True or false: the border is the line round the box. (a) True (b) False
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} -
25.📦 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: 20px;
border: 5px solid black;
margin: 20px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 27.True or false: margin is the gap to other boxes. (a) True (b) False
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 29.Which of these is padding? (a) the text or picture (b) a solid or dotted edge (c) the gap to other boxes (d) the gap round content
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
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: 270px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 33.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) content (d) margin
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} - 37.True or false: the border is the gap to other boxes. (a) True (b) False
- 38.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) margin (d) content
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 1px solid black;
margin: 10px;
}
Answer key
- False
- space outside the border
- 292
- False
- 168
- padding
- the text or picture
- space inside the border
- True
- margin
- 314
- the gap to other boxes
- 168
- True
- 178
- 148
- 104
- 272
- a solid or dotted edge
- 220
- 126
- 258
- True
- 256
- 150
- 136
- True
- 184
- the gap round content
- 360
- 192
- 290
- border
- 250
- 202
- 152
- False
- padding
- 154
- 142
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids