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: the content is the text or picture. (a) True (b) False
-
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: 25px;
border: 5px solid black;
margin: 15px;
} - 3.📦 In the box model, which part is space outside the border? (a) border (b) content (c) padding (d) margin
- 4.Which of these is padding? (a) the line round the box (b) space outside the border (c) the gap round content (d) the text or picture
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
6.📦 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: 10px;
} - 7.📦 In the box model, which part is the gap to other boxes? (a) content (b) margin (c) padding (d) border
- 8.True or false: padding is space inside the border. (a) False (b) True
- 9.Which of these is padding? (a) space inside the border (b) the text or picture (c) the line round the box (d) the gap to other boxes
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 15.True or false: the content is space outside the border. (a) True (b) False
- 16.True or false: the border is the line round the box. (a) False (b) True
- 17.Which of these is the content? (a) the gap to other boxes (b) space outside the border (c) the text or picture (d) the line round the box
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 22.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) content (d) margin
- 23.Which of these is margin? (a) a solid or dotted edge (b) the text or picture (c) the line round the box (d) space outside the border
- 24.📦 In the box model, which part is space inside the border? (a) content (b) border (c) margin (d) padding
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} - 26.True or false: the border is space inside the border. (a) False (b) True
-
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 29.True or false: margin is the text or picture. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
31.📦 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: 15px;
border: 2px solid black;
margin: 10px;
} - 32.True or false: margin is space outside the border. (a) False (b) True
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
35.📦 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: 20px;
border: 2px solid black;
margin: 15px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} - 37.True or false: the content is the line round the box. (a) True (b) False
- 38.True or false: the border is the text or picture. (a) False (b) True
-
39.📦 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: 5px;
border: 2px solid black;
margin: 15px;
} - 40.True or false: the border is a solid or dotted edge. (a) False (b) True
Answer key
- True
- 330
- margin
- the gap round content
- 164
- 202
- margin
- True
- space inside the border
- 98
- 222
- 266
- 134
- 202
- False
- True
- the text or picture
- 358
- 208
- 100
- 186
- border
- space outside the border
- padding
- 198
- False
- 218
- 240
- False
- 268
- 274
- True
- 102
- 356
- 164
- 382
- False
- False
- 104
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids