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: margin is space inside the border. (a) False (b) True
- 2.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) content (d) padding
- 3.📦 In the box model, which part is the text or picture? (a) content (b) border (c) padding (d) margin
-
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: 180px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 5.📦 In the box model, which part is the line round the box? (a) margin (b) border (c) content (d) padding
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} - 7.Which of these is padding? (a) space inside the border (b) the text or picture (c) a solid or dotted edge (d) the gap to other boxes
- 8.Which of these is the border? (a) space inside the border (b) the gap to other boxes (c) space outside the border (d) the line round the box
- 9.True or false: the content is the text or picture. (a) True (b) False
- 10.Which of these is padding? (a) the gap round content (b) space outside the border (c) the text or picture (d) the gap to other boxes
- 11.True or false: margin is space outside the border. (a) True (b) False
-
12.📦 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: 5px;
border: 2px solid black;
margin: 10px;
} - 13.True or false: the content is the line round the box. (a) True (b) False
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
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: 50px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} - 17.True or false: the border is the line round the box. (a) False (b) True
- 18.Which of these is margin? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) space outside the border
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 20.True or false: the content is space inside the border. (a) False (b) True
- 21.Which of these is margin? (a) the gap to other boxes (b) the gap round content (c) a solid or dotted edge (d) space inside the border
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 23.True or false: padding is space inside the border. (a) False (b) True
- 24.Which of these is the content? (a) the text or picture (b) space inside the border (c) the line round the box (d) a solid or dotted edge
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
27.📦 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: 5px;
} - 28.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) margin (d) content
- 29.True or false: padding is the text or picture. (a) True (b) False
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} - 33.True or false: margin is the gap to other boxes. (a) False (b) True
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} - 36.True or false: margin is the text or picture. (a) True (b) False
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 38.True or false: padding is space outside the border. (a) False (b) True
- 39.True or false: the content is the gap to other boxes. (a) False (b) True
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 4px solid black;
margin: 10px;
}
Answer key
- False
- margin
- content
- 246
- border
- 86
- space inside the border
- the line round the box
- True
- the gap round content
- True
- 64
- False
- 186
- 70
- 152
- True
- space outside the border
- 200
- False
- the gap to other boxes
- 378
- True
- the text or picture
- 200
- 154
- 246
- padding
- False
- 102
- 262
- 134
- True
- 216
- 204
- False
- 132
- False
- False
- 118
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids