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 much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 3.📦 In the box model, which part is space outside the border? (a) padding (b) content (c) border (d) margin
- 4.True or false: the content is the gap to other boxes. (a) True (b) False
- 5.True or false: padding is a solid or dotted edge. (a) False (b) True
- 6.True or false: the content is space inside the border. (a) True (b) False
- 7.Which of these is margin? (a) space inside the border (b) the gap to other boxes (c) the gap round content (d) the line round the box
- 8.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
-
9.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 210px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 10.True or false: the content is a solid or dotted edge. (a) False (b) True
- 11.📦 In the box model, which part is the gap to other boxes? (a) margin (b) content (c) padding (d) border
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 14.True or false: padding is space inside the border. (a) False (b) True
- 15.True or false: the border is the gap to other boxes. (a) True (b) False
-
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: 25px;
border: 3px solid black;
margin: 10px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 18.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
-
19.📦 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: 15px;
border: 4px solid black;
margin: 0px;
} - 20.Which of these is the border? (a) the gap round content (b) space outside the border (c) the text or picture (d) a solid or dotted edge
- 21.📦 In the box model, which part is the gap round content? (a) content (b) margin (c) border (d) padding
- 22.Which of these is the border? (a) the gap round content (b) space outside the border (c) the line round the box (d) the gap to other boxes
- 23.True or false: padding is space outside the border. (a) False (b) True
- 24.📦 In the box model, which part is space inside the border? (a) content (b) border (c) padding (d) margin
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
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: 140px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} -
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: 150px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 31.Which of these is margin? (a) the gap round content (b) space inside the border (c) space outside the border (d) a solid or dotted edge
- 32.Which of these is padding? (a) a solid or dotted edge (b) the gap to other boxes (c) space inside the border (d) space outside the border
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
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: 200px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} - 35.Which of these is padding? (a) the text or picture (b) the line round the box (c) the gap to other boxes (d) the gap round content
-
36.📦 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: 20px;
} - 37.True or false: padding is the gap to other boxes. (a) True (b) False
-
38.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 210px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} - 40.Which of these is the content? (a) the text or picture (b) space outside the border (c) the gap to other boxes (d) the gap round content
Answer key
- 110
- 140
- margin
- False
- False
- False
- the gap to other boxes
- border
- 268
- False
- margin
- 262
- 258
- True
- False
- 156
- 154
- content
- 168
- a solid or dotted edge
- padding
- the line round the box
- False
- padding
- 184
- 200
- 180
- 182
- 188
- 362
- space outside the border
- space inside the border
- 266
- 230
- the gap round content
- 204
- False
- 272
- 98
- the text or picture
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids