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: 230px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 2.📦 In the box model, which part is the gap round content? (a) content (b) border (c) padding (d) margin
-
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: 90px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 4.Which of these is padding? (a) space outside the border (b) the line round the box (c) a solid or dotted edge (d) the gap round content
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 6.Which of these is the content? (a) the gap round content (b) space outside the border (c) the gap to other boxes (d) the text or picture
- 7.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) margin (d) border
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 9.Which of these is the border? (a) space outside the border (b) the gap to other boxes (c) space inside the border (d) the line round the box
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
11.📦 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: 2px solid black;
margin: 10px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} - 13.True or false: padding is space inside the border. (a) False (b) True
- 14.Which of these is margin? (a) the gap to other boxes (b) the line round the box (c) the text or picture (d) the gap round content
- 15.Which of these is the border? (a) the gap round content (b) the text or picture (c) a solid or dotted edge (d) the gap to other boxes
-
16.📦 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;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
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: 90px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 21.Which of these is padding? (a) space inside the border (b) the line round the box (c) the text or picture (d) a solid or dotted edge
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 23.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) margin (d) border
- 24.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) border (d) content
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 27.True or false: padding is the gap to other boxes. (a) False (b) True
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} - 29.True or false: margin is the gap to other boxes. (a) False (b) True
-
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: 100px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 31.Which of these is margin? (a) the text or picture (b) the line round the box (c) a solid or dotted edge (d) space outside the border
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 34.True or false: the border is the gap round content. (a) False (b) True
-
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: 230px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 37.True or false: the content is the text or picture. (a) False (b) True
-
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: 300px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 39.True or false: the border is a solid or dotted edge. (a) False (b) True
-
40.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 200px;
padding: 30px;
border: 1px solid black;
margin: 5px;
}
Answer key
- 248
- padding
- 124
- the gap round content
- 136
- the text or picture
- padding
- 150
- the line round the box
- 136
- 174
- 170
- True
- the gap to other boxes
- a solid or dotted edge
- 236
- 304
- 128
- 304
- 118
- space inside the border
- 246
- border
- margin
- 196
- 274
- False
- 274
- True
- 128
- space outside the border
- 140
- 288
- False
- 300
- 244
- True
- 344
- True
- 262
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids