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.Which of these is the border? (a) the gap round content (b) space outside the border (c) the gap to other boxes (d) the line round the box
-
2.📦 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: 30px;
border: 5px solid black;
margin: 5px;
} - 3.True or false: padding is the gap round content. (a) True (b) False
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} - 5.Which of these is the content? (a) space outside the border (b) space inside the border (c) the text or picture (d) a solid or dotted edge
- 6.True or false: the content is the gap round content. (a) True (b) False
-
7.📦 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: 4px solid black;
margin: 0px;
} -
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: 180px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
9.📦 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: 30px;
border: 1px solid black;
margin: 15px;
} - 10.True or false: margin is space inside the border. (a) False (b) True
- 11.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) space inside the border (d) the gap to other boxes
- 12.True or false: margin is space outside the border. (a) True (b) False
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 14.True or false: padding is space inside the border. (a) True (b) False
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 16.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) border (d) content
- 17.📦 In the box model, which part is a solid or dotted edge? (a) border (b) margin (c) content (d) padding
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} -
21.📦 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: 2px solid black;
margin: 15px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} - 26.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) content (d) margin
- 27.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) padding (d) border
- 28.True or false: margin is the line round the box. (a) False (b) True
- 29.Which of these is margin? (a) the gap round content (b) space outside the border (c) the line round the box (d) a solid or dotted edge
- 30.Which of these is padding? (a) the gap round content (b) a solid or dotted edge (c) the line round the box (d) space outside the border
-
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 32.True or false: the border is space inside the border. (a) False (b) True
- 33.True or false: the border is the line round the box. (a) False (b) True
- 34.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) padding (d) border
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 36.True or false: padding is the gap to other boxes. (a) False (b) True
-
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 5px solid black;
margin: 10px;
}
Answer key
- the line round the box
- 340
- True
- 280
- the text or picture
- False
- 178
- 240
- 152
- False
- a solid or dotted edge
- True
- 358
- True
- 264
- content
- border
- 282
- 246
- 286
- 264
- 82
- 216
- 102
- 138
- margin
- padding
- False
- space outside the border
- the gap round content
- 116
- False
- True
- border
- 144
- False
- 132
- 350
- 298
- 330
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids