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