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 to other boxes. (a) False (b) True
- 2.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) margin (d) border
- 3.Which of these is padding? (a) the text or picture (b) a solid or dotted edge (c) space outside the border (d) space inside the border
-
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: 280px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 6.True or false: the content is the text or picture. (a) False (b) True
- 7.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) margin (d) border
-
8.📦 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;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} - 11.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) content (d) padding
-
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 13.True or false: padding is the gap round content. (a) False (b) True
- 14.True or false: the border is a solid or dotted edge. (a) False (b) True
- 15.Which of these is margin? (a) space inside the border (b) the gap to other boxes (c) the line round the box (d) the gap round content
- 16.True or false: margin is space inside the border. (a) False (b) True
- 17.Which of these is padding? (a) the line round the box (b) the text or picture (c) the gap round content (d) a solid or dotted edge
- 18.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) space outside the border
- 19.True or false: the content is space inside the border. (a) True (b) False
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 21.True or false: padding is the text or picture. (a) True (b) False
- 22.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) padding (d) border
-
23.📦 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: 5px solid black;
margin: 15px;
} - 24.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) content (d) padding
-
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: 25px;
border: 2px solid black;
margin: 15px;
} - 26.Which of these is margin? (a) the line round the box (b) space inside the border (c) space outside the border (d) the text or picture
- 27.True or false: margin is the gap round content. (a) True (b) False
- 28.True or false: margin is the gap to other boxes. (a) False (b) True
- 29.True or false: the content is the line round the box. (a) True (b) False
-
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: 25px;
border: 3px solid black;
margin: 5px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} -
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: 140px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 33.True or false: margin is the line round the box. (a) True (b) False
- 34.True or false: the border is the line round the box. (a) False (b) True
- 35.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} -
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: 4px solid black;
margin: 0px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
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: 80px;
padding: 10px;
border: 1px solid black;
margin: 15px;
}
Answer key
- False
- border
- space inside the border
- 316
- 168
- True
- border
- 248
- 112
- 234
- padding
- 114
- True
- True
- the gap to other boxes
- False
- the gap round content
- a solid or dotted edge
- False
- 282
- False
- content
- 180
- margin
- 164
- space outside the border
- False
- True
- False
- 156
- 130
- 164
- False
- True
- padding
- 162
- 164
- 348
- 142
- 102
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids