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) content (b) padding (c) margin (d) border
- 2.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 6.Which of these is the border? (a) the text or picture (b) space outside the border (c) a solid or dotted edge (d) the gap round content
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 8.True or false: the border is space outside the border. (a) True (b) False
-
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
10.📦 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: 20px;
border: 1px solid black;
margin: 0px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
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: 25px;
border: 3px solid black;
margin: 15px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} - 14.Which of these is margin? (a) the gap round content (b) space inside the border (c) space outside the border (d) the line round the box
-
15.📦 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: 15px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} - 18.Which of these is the content? (a) the line round the box (b) space inside the border (c) space outside the border (d) the text or picture
- 19.Which of these is the border? (a) space outside the border (b) the gap to other boxes (c) the line round the box (d) the text or picture
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 10px;
border: 1px 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: 100px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
22.📦 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: 15px;
border: 2px solid black;
margin: 10px;
} - 23.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) space inside the border (d) the line round the box
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 25.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
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: 60px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} - 28.True or false: the content is a solid or dotted edge. (a) True (b) False
-
29.📦 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: 0px;
} - 30.True or false: margin is the line round the box. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 32.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 34.True or false: the content is the text or picture. (a) False (b) True
-
35.📦 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: 15px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} - 37.📦 In the box model, which part is the line round the box? (a) margin (b) border (c) content (d) padding
-
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} - 40.📦 In the box model, which part is the gap round content? (a) border (b) content (c) padding (d) margin
Answer key
- margin
- content
- 244
- 226
- 114
- a solid or dotted edge
- 166
- False
- 302
- 192
- 250
- 106
- 106
- space outside the border
- 266
- 184
- 270
- the text or picture
- the line round the box
- 132
- 166
- 214
- space inside the border
- 306
- padding
- 130
- 112
- False
- 66
- False
- 356
- border
- 80
- True
- 218
- 332
- border
- 214
- 246
- padding
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids