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: 240px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 2.True or false: margin is space outside the border. (a) False (b) True
- 3.📦 In the box model, which part is space inside the border? (a) padding (b) margin (c) border (d) content
- 4.📦 In the box model, which part is the gap round content? (a) padding (b) margin (c) content (d) border
- 5.📦 In the box model, which part is a solid or dotted edge? (a) content (b) margin (c) padding (d) border
-
6.📦 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: 1px solid black;
margin: 15px;
} - 7.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) margin (d) border
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 4px solid black;
margin: 20px;
} - 9.Which of these is padding? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the text or picture
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 12.Which of these is the border? (a) the line round the box (b) space inside the border (c) space outside the border (d) the text or picture
- 13.Which of these is the content? (a) a solid or dotted edge (b) the gap round content (c) the text or picture (d) the gap to other boxes
- 14.Which of these is margin? (a) the line round the box (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
15.📦 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: 4px solid black;
margin: 5px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 18.📦 In the box model, which part is the line round the box? (a) margin (b) content (c) border (d) padding
-
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} - 22.True or false: margin is space inside the border. (a) False (b) True
- 23.Which of these is padding? (a) the gap round content (b) the gap to other boxes (c) the line round the box (d) space outside the border
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} - 25.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) border (d) padding
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} - 27.Which of these is margin? (a) the line round the box (b) space inside the border (c) the text or picture (d) space outside the border
- 28.True or false: the content is the gap round content. (a) True (b) False
-
29.📦 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: 30px;
border: 5px solid black;
margin: 10px;
} -
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: 260px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 31.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 34.True or false: padding is the gap to other boxes. (a) False (b) True
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 37.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} - 39.True or false: margin is a solid or dotted edge. (a) True (b) False
- 40.True or false: margin is the gap to other boxes. (a) False (b) True
Answer key
- 262
- True
- padding
- padding
- border
- 212
- margin
- 148
- space inside the border
- 322
- 168
- the line round the box
- the text or picture
- the gap to other boxes
- 158
- 114
- 62
- border
- 170
- 190
- 192
- False
- the gap round content
- 268
- margin
- 330
- space outside the border
- False
- 240
- 304
- content
- 248
- 142
- False
- 212
- 252
- a solid or dotted edge
- 162
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids