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 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: 30px;
border: 1px solid black;
margin: 15px;
} - 2.True or false: margin is the gap round content. (a) True (b) False
- 3.Which of these is padding? (a) the text or picture (b) space outside the border (c) space inside the border (d) the gap to other boxes
- 4.📦 In the box model, which part is a solid or dotted edge? (a) content (b) border (c) margin (d) padding
- 5.True or false: padding is the line round the box. (a) True (b) False
- 6.True or false: padding is the gap round content. (a) True (b) False
- 7.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
-
8.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 260px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
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: 30px;
border: 4px solid black;
margin: 10px;
} -
11.📦 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: 5px;
} - 12.True or false: padding is the text or picture. (a) False (b) True
- 13.Which of these is padding? (a) the line round the box (b) the gap round content (c) space outside the border (d) the text or picture
- 14.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} - 16.📦 In the box model, which part is the gap to other boxes? (a) border (b) padding (c) margin (d) content
- 17.Which of these is the content? (a) the text or picture (b) space inside the border (c) space outside the border (d) the gap to other boxes
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 19.True or false: margin is space outside the border. (a) False (b) True
- 20.Which of these is the border? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) the line round the box
- 21.Which of these is margin? (a) a solid or dotted edge (b) space outside the border (c) space inside the border (d) the line round the box
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} - 23.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
- 24.Which of these is margin? (a) the gap to other boxes (b) a solid or dotted edge (c) the gap round content (d) space inside the border
-
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: 110px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 26.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) padding (d) content
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
28.📦 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: 10px;
border: 4px solid black;
margin: 0px;
} - 29.True or false: the border is the line round the box. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 4px 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: 200px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 5px 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: 80px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
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: 250px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
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: 140px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} - 39.True or false: the content is the line round the box. (a) True (b) False
- 40.True or false: the border is space outside the border. (a) False (b) True
Answer key
- 202
- False
- space inside the border
- border
- False
- True
- content
- 272
- 136
- 288
- 98
- False
- the gap round content
- border
- 238
- margin
- the text or picture
- 136
- True
- the line round the box
- space outside the border
- 176
- a solid or dotted edge
- the gap to other boxes
- 132
- padding
- 172
- 198
- True
- 178
- 238
- 238
- 118
- 180
- 112
- 314
- 294
- 188
- False
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids