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: 170px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} - 2.True or false: the border is the gap round content. (a) True (b) False
-
3.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 220px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 5.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
-
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: 25px;
border: 3px solid black;
margin: 0px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 8.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) margin (d) content
- 9.True or false: the content is space outside the border. (a) True (b) False
- 10.Which of these is margin? (a) space outside the border (b) the gap round content (c) the text or picture (d) space inside the border
- 11.Which of these is the border? (a) the gap round content (b) the line round the box (c) space inside the border (d) the gap to other boxes
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} -
14.📦 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: 30px;
border: 3px solid black;
margin: 10px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 16.Which of these is padding? (a) space inside the border (b) space outside the border (c) a solid or dotted edge (d) the gap to other boxes
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 18.📦 In the box model, which part is the gap to other boxes? (a) content (b) margin (c) border (d) padding
- 19.Which of these is the border? (a) space outside the border (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 21.True or false: margin is space outside the border. (a) True (b) False
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} -
23.📦 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: 20px;
border: 1px solid black;
margin: 0px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 26.📦 In the box model, which part is a solid or dotted edge? (a) content (b) padding (c) margin (d) border
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 31.True or false: the content is the text or picture. (a) False (b) True
-
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} -
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
36.📦 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: 20px;
border: 5px solid black;
margin: 0px;
} - 37.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) padding (d) border
- 38.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
- 39.True or false: padding is space inside the border. (a) False (b) True
- 40.Which of these is padding? (a) the line round the box (b) a solid or dotted edge (c) the text or picture (d) the gap round content
Answer key
- 262
- False
- 290
- 168
- border
- 246
- 204
- padding
- False
- space outside the border
- the line round the box
- 208
- 230
- 166
- 166
- space inside the border
- 114
- margin
- a solid or dotted edge
- 294
- True
- 170
- 132
- 196
- 362
- border
- 124
- 316
- 294
- 172
- True
- 110
- 216
- 196
- 300
- 250
- margin
- content
- True
- the gap round content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids