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: the content is the gap round content. (a) False (b) True
- 2.True or false: margin is the line round the box. (a) True (b) False
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
5.📦 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: 25px;
border: 5px solid black;
margin: 0px;
} - 6.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) margin (d) content
-
7.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 220px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 12.Which of these is margin? (a) space outside the border (b) the line round the box (c) space inside the border (d) the gap round content
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 14.Which of these is padding? (a) space outside the border (b) the gap round content (c) the line round the box (d) the text or picture
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
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: 110px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
17.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 18.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) margin (d) border
- 19.True or false: the border is the gap round content. (a) False (b) True
- 20.True or false: padding is the line round the box. (a) False (b) True
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} - 22.True or false: the border is space inside the border. (a) True (b) False
- 23.📦 In the box model, which part is the text or picture? (a) content (b) border (c) padding (d) margin
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 25.True or false: padding is space inside the border. (a) True (b) False
-
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: 80px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} - 29.Which of these is the border? (a) the line round the box (b) the gap to other boxes (c) space inside the border (d) the gap round content
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
31.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 90px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} - 33.Which of these is the content? (a) the text or picture (b) space outside the border (c) the gap round content (d) a solid or dotted edge
-
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: 100px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 35.True or false: margin is space outside the border. (a) True (b) False
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} - 38.📦 In the box model, which part is the gap round content? (a) content (b) border (c) padding (d) margin
- 39.Which of these is the border? (a) space inside the border (b) space outside the border (c) a solid or dotted edge (d) the gap to other boxes
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 5px solid black;
margin: 0px;
}
Answer key
- False
- False
- 86
- 146
- 240
- padding
- 140
- 162
- 146
- 258
- 174
- space outside the border
- 150
- the gap round content
- 252
- 172
- 100
- margin
- False
- False
- 266
- False
- content
- 158
- True
- 138
- 194
- 162
- the line round the box
- 236
- 128
- 210
- the text or picture
- 168
- True
- 198
- 200
- padding
- a solid or dotted edge
- 180
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids