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.True or false: padding is the gap round content. (a) False (b) True
- 2.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) border (d) content
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 5.Which of these is margin? (a) space outside the border (b) space inside the border (c) the text or picture (d) a solid or dotted edge
- 6.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) content (d) margin
-
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: 80px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} - 8.True or false: padding is space inside the border. (a) True (b) False
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 230px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 11.📦 In the box model, which part is the gap round content? (a) border (b) content (c) padding (d) margin
-
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 13.True or false: padding is space outside the border. (a) True (b) False
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} - 18.True or false: the content is space outside the border. (a) False (b) True
- 19.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
-
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: 160px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} - 21.📦 In the box model, which part is the gap to other boxes? (a) border (b) padding (c) margin (d) content
-
22.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 26.True or false: the content is the gap round content. (a) True (b) False
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 28.True or false: the content is a solid or dotted edge. (a) True (b) False
- 29.True or false: the content is the gap to other boxes. (a) False (b) True
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} -
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: 180px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} -
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} - 38.True or false: margin is the gap to other boxes. (a) True (b) False
-
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} - 40.Which of these is the border? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the text or picture
Answer key
- True
- content
- 242
- 148
- space outside the border
- border
- 122
- True
- 124
- 272
- padding
- 178
- False
- 240
- 184
- 242
- 210
- False
- margin
- 212
- margin
- 92
- 96
- 250
- 204
- False
- 368
- False
- False
- 160
- 114
- 314
- 160
- 200
- 182
- 126
- 198
- True
- 84
- a solid or dotted edge
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids