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 a solid or dotted edge? (a) border (b) padding (c) margin (d) content
- 2.True or false: the content is the line round the box. (a) True (b) False
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 4.Which of these is the content? (a) space outside the border (b) the gap round content (c) the text or picture (d) space inside the border
- 5.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the text or picture (d) the gap to other boxes
- 6.True or false: padding is the gap round content. (a) False (b) True
-
7.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 150px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 8.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
- 9.Which of these is margin? (a) space inside the border (b) the line round the box (c) a solid or dotted edge (d) space outside the border
- 10.True or false: margin is space inside the border. (a) True (b) False
-
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 12.Which of these is the border? (a) the text or picture (b) space inside the border (c) the line round the box (d) space outside the border
- 13.True or false: the content is the text or picture. (a) True (b) False
- 14.📦 In the box model, which part is space outside the border? (a) content (b) border (c) margin (d) padding
- 15.True or false: margin is space outside the border. (a) False (b) True
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 17.Which of these is padding? (a) the gap round content (b) the gap to other boxes (c) space outside the border (d) the line round the box
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 19.True or false: the border is a solid or dotted edge. (a) False (b) True
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} - 21.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
- 22.📦 In the box model, which part is the text or picture? (a) border (b) margin (c) content (d) padding
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 28.True or false: padding is space inside the border. (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: 110px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 30.Which of these is padding? (a) the text or picture (b) the line round the box (c) space inside the border (d) space outside the border
- 31.True or false: margin is the gap round content. (a) False (b) True
-
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
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: 170px;
padding: 5px;
border: 3px solid black;
margin: 5px;
} -
34.📦 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: 1px solid black;
margin: 5px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} - 37.True or false: the border is space outside the border. (a) False (b) True
- 38.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) the line round the box (d) the gap to other boxes
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 3px solid black;
margin: 20px;
}
Answer key
- border
- False
- 164
- the text or picture
- a solid or dotted edge
- True
- 176
- padding
- space outside the border
- False
- 194
- the line round the box
- True
- margin
- True
- 116
- the gap round content
- 114
- True
- 230
- padding
- content
- 264
- 100
- 242
- 240
- 202
- True
- 122
- space inside the border
- False
- 108
- 186
- 122
- 122
- 138
- False
- the gap to other boxes
- 330
- 166
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids