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 the line round the box? (a) content (b) padding (c) border (d) margin
- 2.True or false: margin is the text or picture. (a) True (b) False
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} - 4.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
5.📦 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: 10px;
} - 6.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) margin (d) border
-
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: 140px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
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: 170px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 9.True or false: padding is space outside the border. (a) False (b) True
- 10.True or false: the content is space outside the border. (a) True (b) False
- 11.True or false: the content is space inside the border. (a) False (b) True
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 14.True or false: margin is the gap to other boxes. (a) True (b) False
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 16.Which of these is the content? (a) space outside the border (b) space inside the border (c) the text or picture (d) the gap round content
-
17.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 240px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} - 21.Which of these is the border? (a) the gap to other boxes (b) the line round the box (c) the gap round content (d) the text or picture
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} - 23.True or false: margin is space outside the border. (a) False (b) True
-
24.📦 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: 20px;
border: 5px solid black;
margin: 0px;
} - 25.True or false: the content is the gap to other boxes. (a) True (b) False
- 26.True or false: margin is the line round the box. (a) True (b) False
- 27.Which of these is margin? (a) the gap round content (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 28.Which of these is padding? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the line round the box
- 29.Which of these is margin? (a) a solid or dotted edge (b) space outside the border (c) the gap round content (d) space inside the border
- 30.📦 In the box model, which part is the gap to other boxes? (a) margin (b) border (c) content (d) padding
- 31.Which of these is padding? (a) the text or picture (b) space outside the border (c) a solid or dotted edge (d) space inside the border
- 32.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) space outside the border (d) the gap to other boxes
- 33.True or false: padding is the gap round content. (a) True (b) False
- 34.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 38.True or false: the border is the gap round content. (a) False (b) True
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 5px;
border: 3px solid black;
margin: 0px;
}
Answer key
- border
- False
- 130
- content
- 104
- padding
- 202
- 238
- False
- False
- False
- 174
- 164
- True
- 232
- the text or picture
- 282
- 246
- 212
- 202
- the line round the box
- 298
- True
- 270
- False
- False
- the gap to other boxes
- the gap round content
- space outside the border
- margin
- space inside the border
- a solid or dotted edge
- True
- padding
- 226
- 214
- 214
- False
- 250
- 316
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids