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 content? (a) the text or picture (b) the line round the box (c) the gap round content (d) the gap to other boxes
- 2.📦 In the box model, which part is the text or picture? (a) padding (b) content (c) border (d) margin
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} - 4.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) the gap to other boxes (d) the line round the box
- 5.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) padding (d) content
- 6.True or false: the content is the text or picture. (a) False (b) True
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} - 8.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) space inside the border (d) the gap to other boxes
-
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: 290px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} - 13.True or false: margin is the gap to other boxes. (a) True (b) False
-
14.📦 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: 10px;
border: 4px solid black;
margin: 10px;
} -
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: 270px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 16.Which of these is the border? (a) the text or picture (b) the gap round content (c) a solid or dotted edge (d) space inside the border
- 17.True or false: the border is the gap round content. (a) True (b) False
-
18.📦 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;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} - 21.True or false: margin is the gap round content. (a) True (b) False
- 22.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
- 23.📦 In the box model, which part is a solid or dotted edge? (a) border (b) padding (c) margin (d) content
- 24.True or false: margin is the text or picture. (a) True (b) False
-
25.📦 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: 5px;
} - 26.True or false: the content is space outside the border. (a) True (b) False
-
27.📦 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: 15px;
border: 2px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
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: 170px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} - 31.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) margin (d) border
-
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: 70px;
padding: 15px;
border: 3px solid black;
margin: 20px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} - 35.Which of these is the border? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap round content
- 36.True or false: the content is the gap to other boxes. (a) True (b) False
-
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 38.Which of these is margin? (a) the gap round content (b) the line round the box (c) a solid or dotted edge (d) space outside the border
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 40.Which of these is padding? (a) the gap round content (b) the text or picture (c) the line round the box (d) space outside the border
Answer key
- the text or picture
- content
- 210
- the gap to other boxes
- margin
- True
- 202
- space inside the border
- 338
- 302
- 284
- 340
- True
- 148
- 312
- a solid or dotted edge
- False
- 238
- 220
- 158
- False
- padding
- border
- False
- 96
- False
- 144
- 204
- 250
- 202
- margin
- 106
- 168
- 298
- the line round the box
- False
- 78
- space outside the border
- 144
- the gap round content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids