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 text or picture? (a) border (b) margin (c) padding (d) content
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} - 3.True or false: margin is a solid or dotted edge. (a) True (b) False
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 7.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
-
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: 60px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} - 9.True or false: padding is space inside the border. (a) False (b) True
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 4px 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: 60px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} - 13.True or false: the content is the line round the box. (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: 230px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 15.True or false: the content is the text or picture. (a) True (b) False
- 16.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) content (d) padding
-
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: 90px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 18.True or false: the content is a solid or dotted edge. (a) False (b) True
-
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} - 20.True or false: margin is space outside the border. (a) False (b) True
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} - 22.Which of these is margin? (a) the gap round content (b) the text or picture (c) a solid or dotted edge (d) space outside the border
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 24.Which of these is margin? (a) the text or picture (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 26.Which of these is the content? (a) the gap to other boxes (b) the text or picture (c) space outside the border (d) space inside the border
- 27.True or false: the border is the line round the box. (a) True (b) False
-
28.📦 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: 25px;
border: 2px solid black;
margin: 10px;
} - 29.True or false: padding is the gap to other boxes. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 1px solid black;
margin: 20px;
} - 31.True or false: margin is space inside the border. (a) True (b) False
- 32.True or false: the border is space inside the border. (a) True (b) False
-
33.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 260px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} - 34.True or false: the content is the gap round content. (a) False (b) True
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 36.Which of these is padding? (a) a solid or dotted edge (b) space inside the border (c) the line round the box (d) the text or picture
- 37.True or false: padding is the gap round content. (a) False (b) True
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 25px;
border: 4px solid black;
margin: 0px;
}
Answer key
- content
- 120
- False
- 266
- 302
- 150
- border
- 104
- True
- 326
- 218
- 122
- False
- 244
- True
- margin
- 122
- False
- 216
- True
- 140
- space outside the border
- 190
- the gap to other boxes
- 242
- the text or picture
- True
- 224
- False
- 232
- False
- False
- 272
- False
- 84
- space inside the border
- True
- 218
- 176
- 218
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids