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 border is the text or picture. (a) False (b) True
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
3.📦 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: 5px;
border: 5px solid black;
margin: 10px;
} - 4.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) content (d) border
-
5.📦 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: 10px;
border: 3px solid black;
margin: 15px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 7.True or false: padding is space inside the border. (a) True (b) False
- 8.True or false: margin is a solid or dotted edge. (a) False (b) True
- 9.Which of these is the content? (a) the text or picture (b) a solid or dotted edge (c) the line round the box (d) space inside the border
-
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: 240px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 12.Which of these is padding? (a) the gap to other boxes (b) space inside the border (c) a solid or dotted edge (d) the text or picture
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 14.Which of these is margin? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 15.True or false: margin is the text or picture. (a) False (b) True
- 16.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) padding (d) border
- 17.Which of these is margin? (a) the gap round content (b) space outside the border (c) a solid or dotted edge (d) space inside the border
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 20.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) border (d) margin
- 21.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 26.📦 In the box model, which part is the line round the box? (a) margin (b) padding (c) content (d) border
-
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 4px 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: 80px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
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: 120px;
padding: 30px;
border: 3px solid black;
margin: 0px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
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: 90px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 37.True or false: margin is space inside the border. (a) True (b) False
-
38.📦 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: 10px;
border: 4px solid black;
margin: 5px;
} - 39.True or false: the content is the text or picture. (a) False (b) True
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 3px solid black;
margin: 5px;
}
Answer key
- False
- 368
- 290
- margin
- 296
- 168
- True
- False
- the text or picture
- 258
- 224
- space inside the border
- 240
- the gap to other boxes
- False
- margin
- space outside the border
- 52
- 92
- padding
- border
- 300
- 124
- 140
- 310
- border
- 232
- 192
- 128
- 98
- 176
- 196
- 186
- 200
- 160
- 292
- False
- 158
- True
- 76
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids