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 line round the box? (a) border (b) margin (c) content (d) padding
- 2.Which of these is the content? (a) space inside the border (b) space outside the border (c) a solid or dotted edge (d) the text or picture
- 3.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) the text or picture (d) space outside the border
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 5.True or false: margin is the gap round content. (a) True (b) False
- 6.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) margin (c) content (d) border
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 8.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) content (d) padding
- 9.Which of these is padding? (a) the text or picture (b) space outside the border (c) space inside the border (d) a solid or dotted edge
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 12.True or false: padding is space inside the border. (a) True (b) False
- 13.True or false: the border is a solid or dotted edge. (a) False (b) True
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 15.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) content (d) margin
- 16.True or false: margin is space inside the border. (a) True (b) False
- 17.True or false: the content is space outside the border. (a) False (b) True
-
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: 10px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} -
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: 270px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 21.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) margin (d) padding
- 22.📦 In the box model, which part is space inside the border? (a) margin (b) padding (c) content (d) border
- 23.True or false: margin is the gap to other boxes. (a) True (b) False
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 4px 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: 280px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 30.Which of these is margin? (a) the gap to other boxes (b) the gap round content (c) a solid or dotted edge (d) the text or picture
- 31.True or false: the border is space outside the border. (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: 300px;
padding: 5px;
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: 190px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 35.True or false: the content is a solid or dotted edge. (a) False (b) True
-
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} - 38.True or false: padding is the line round the box. (a) False (b) True
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 30px;
border: 1px solid black;
margin: 5px;
}
Answer key
- border
- the text or picture
- the gap round content
- 224
- False
- border
- 202
- padding
- space inside the border
- 304
- 362
- True
- True
- 128
- content
- False
- False
- 72
- 342
- 324
- margin
- padding
- True
- 100
- 238
- 292
- 376
- 132
- 270
- the gap to other boxes
- False
- 316
- 220
- 170
- False
- 170
- 240
- False
- 342
- 332
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids