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: margin is space outside the border. (a) False (b) True
- 2.Which of these is margin? (a) the line round the box (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
- 3.Which of these is padding? (a) space inside the border (b) a solid or dotted edge (c) the text or picture (d) the gap to other boxes
- 4.Which of these is the content? (a) the gap to other boxes (b) the gap round content (c) the text or picture (d) space inside the border
- 5.📦 In the box model, which part is space outside the border? (a) content (b) border (c) margin (d) padding
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 9.📦 In the box model, which part is the gap to other boxes? (a) border (b) padding (c) content (d) margin
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
11.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 13.True or false: the content is a solid or dotted edge. (a) True (b) False
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 15.True or false: padding is space inside the border. (a) True (b) False
- 16.Which of these is margin? (a) the line round the box (b) space outside the border (c) the gap round content (d) a solid or dotted edge
-
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: 80px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
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: 80px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 19.True or false: padding is the gap round content. (a) False (b) True
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} -
21.📦 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: 15px;
} - 22.📦 In the box model, which part is the line round the box? (a) padding (b) content (c) border (d) margin
-
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 25.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) margin (d) content
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 27.True or false: the border is the gap round content. (a) False (b) True
- 28.Which of these is the border? (a) the gap round content (b) space inside the border (c) the line round the box (d) the gap to other boxes
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
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: 220px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
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: 130px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} - 33.True or false: padding is a solid or dotted edge. (a) False (b) True
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
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: 160px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} - 36.True or false: padding is space outside the border. (a) True (b) False
- 37.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 39.True or false: the content is the text or picture. (a) False (b) True
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 4px solid black;
margin: 5px;
}
Answer key
- True
- the gap to other boxes
- space inside the border
- the text or picture
- margin
- 114
- 72
- 354
- margin
- 74
- 102
- 114
- False
- 214
- True
- space outside the border
- 112
- 118
- True
- 204
- 244
- border
- 352
- 236
- border
- 232
- False
- the line round the box
- 228
- 100
- 276
- 200
- False
- 182
- 190
- False
- a solid or dotted edge
- 224
- True
- 218
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids