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.📦 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: 30px;
border: 5px solid black;
margin: 20px;
} - 2.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
- 3.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
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: 170px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} - 6.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) space outside the border (d) the gap round content
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 9.True or false: the content is a solid or dotted edge. (a) False (b) True
- 10.True or false: margin is space outside the border. (a) True (b) False
-
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: 130px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} - 13.Which of these is the content? (a) a solid or dotted edge (b) the gap to other boxes (c) the text or picture (d) the line round the box
-
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: 270px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} -
16.📦 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: 10px;
border: 5px solid black;
margin: 0px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 18.True or false: padding is the gap to other boxes. (a) True (b) False
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
20.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 21.Which of these is margin? (a) space inside the border (b) the gap round content (c) the gap to other boxes (d) the line round the box
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 23.True or false: margin is space inside the border. (a) True (b) False
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
25.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 140px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} -
26.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 200px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} - 27.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) content (d) padding
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} - 30.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
-
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: 50px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 33.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 35.True or false: margin is the text or picture. (a) False (b) True
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
37.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 110px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 38.Which of these is the border? (a) the text or picture (b) the line round the box (c) space outside the border (d) space inside the border
- 39.True or false: the border is the line round the box. (a) True (b) False
-
40.📦 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: 4px solid black;
margin: 20px;
}
Answer key
- 120
- content
- padding
- 176
- 202
- space outside the border
- 138
- 122
- False
- True
- 152
- 218
- the text or picture
- 292
- 398
- 130
- 258
- False
- 240
- 228
- the gap to other boxes
- 148
- False
- 192
- 210
- 248
- padding
- 152
- 224
- border
- 120
- 126
- margin
- 232
- False
- 306
- 154
- the line round the box
- True
- 168
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids