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 space outside the border? (a) padding (b) border (c) content (d) margin
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} -
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} -
4.📦 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: 10px;
} -
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 6.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) border (d) margin
- 7.True or false: the border is the gap to other boxes. (a) True (b) False
-
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: 190px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} - 9.Which of these is margin? (a) the text or picture (b) the line round the box (c) space outside the border (d) a solid or dotted edge
- 10.Which of these is the border? (a) the line round the box (b) the gap round content (c) the text or picture (d) space outside the border
-
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: 230px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
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: 280px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} - 13.Which of these is margin? (a) the text or picture (b) the gap to other boxes (c) a solid or dotted edge (d) the line round the box
- 14.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
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: 200px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 17.Which of these is padding? (a) the gap round content (b) space outside the border (c) a solid or dotted edge (d) the text or picture
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 19.True or false: margin is space outside the border. (a) False (b) True
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} - 21.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) the gap to other boxes (d) the text or picture
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 23.True or false: the border is the line round the box. (a) True (b) False
- 24.📦 In the box model, which part is the gap round content? (a) padding (b) border (c) margin (d) content
- 25.True or false: padding is the gap round content. (a) True (b) False
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
27.📦 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: 3px solid black;
margin: 20px;
} - 28.Which of these is padding? (a) the text or picture (b) space inside the border (c) space outside the border (d) the line round the box
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
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: 120px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} - 31.True or false: margin is the line round the box. (a) False (b) True
-
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: 90px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} -
33.📦 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: 5px;
} - 34.Which of these is the content? (a) the line round the box (b) space outside the border (c) space inside the border (d) the text or picture
- 35.📦 In the box model, which part is space inside the border? (a) margin (b) padding (c) border (d) content
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} - 39.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) border (d) margin
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 4px solid black;
margin: 0px;
}
Answer key
- margin
- 238
- 252
- 292
- 122
- border
- False
- 260
- space outside the border
- the line round the box
- 268
- 344
- the gap to other boxes
- content
- 370
- 264
- the gap round content
- 274
- True
- 208
- a solid or dotted edge
- 158
- True
- padding
- True
- 288
- 286
- space inside the border
- 254
- 174
- False
- 130
- 82
- the text or picture
- padding
- 164
- 242
- 190
- margin
- 228
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids