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) border (c) padding (d) content
- 2.True or false: the content is a solid or dotted edge. (a) True (b) False
-
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: 300px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
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: 260px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} - 5.True or false: padding is the gap round content. (a) True (b) False
-
6.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 50px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 8.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the gap to other boxes (d) the gap round content
- 9.Which of these is padding? (a) the text or picture (b) the gap round content (c) the gap to other boxes (d) space outside the border
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} - 11.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) margin (d) content
- 12.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) content (d) padding
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 14.True or false: padding is a solid or dotted edge. (a) True (b) False
-
15.📦 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: 25px;
border: 2px solid black;
margin: 20px;
} - 16.📦 In the box model, which part is the gap round content? (a) padding (b) margin (c) content (d) border
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 19.Which of these is margin? (a) the text or picture (b) space outside the border (c) space inside the border (d) the gap round content
-
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: 50px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} - 21.True or false: the border is the line round the box. (a) False (b) True
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} - 23.Which of these is the content? (a) space inside the border (b) a solid or dotted edge (c) the text or picture (d) the gap round content
- 24.True or false: the border is space outside the border. (a) True (b) False
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 27.True or false: the border is the text or picture. (a) False (b) True
- 28.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) margin (d) content
- 29.True or false: the border is a solid or dotted edge. (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: 120px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} - 32.True or false: the content is space outside the border. (a) False (b) True
- 33.True or false: the content is space inside the border. (a) False (b) True
-
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: 250px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 36.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) the gap to other boxes (d) space outside the border
-
37.📦 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: 1px solid black;
margin: 10px;
} - 38.Which of these is padding? (a) a solid or dotted edge (b) the text or picture (c) space outside the border (d) space inside the border
- 39.True or false: the border is the gap to other boxes. (a) False (b) True
- 40.True or false: margin is space outside the border. (a) False (b) True
Answer key
- margin
- False
- 352
- 288
- True
- 104
- 244
- the gap to other boxes
- the gap round content
- 274
- content
- border
- 188
- False
- 284
- padding
- 200
- 162
- space outside the border
- 106
- True
- 162
- the text or picture
- False
- 282
- 254
- False
- padding
- True
- 132
- 154
- False
- False
- 308
- 200
- a solid or dotted edge
- 152
- space inside the border
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids