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 space inside the border? (a) margin (b) border (c) padding (d) content
- 2.Which of these is margin? (a) the text or picture (b) space outside the border (c) a solid or dotted edge (d) space inside the border
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 6.True or false: the content is space inside the border. (a) True (b) False
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
8.📦 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: 2px solid black;
margin: 0px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} -
13.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} -
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: 150px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 17.Which of these is margin? (a) space inside the border (b) the line round the box (c) the gap to other boxes (d) the text or picture
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 19.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) content (d) padding
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} - 22.Which of these is the border? (a) space outside the border (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 23.True or false: margin is the gap round content. (a) True (b) False
- 24.True or false: the border is space outside the border. (a) True (b) False
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 26.True or false: padding is the gap to other boxes. (a) True (b) False
-
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 29.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) content (d) margin
-
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: 120px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
31.📦 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: 1px solid black;
margin: 0px;
} -
32.📦 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: 5px;
border: 3px solid black;
margin: 10px;
} - 33.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
- 34.True or false: margin is space outside the border. (a) True (b) False
-
35.📦 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: 5px;
border: 2px solid black;
margin: 0px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
39.📦 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: 25px;
border: 1px solid black;
margin: 20px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 5px solid black;
margin: 0px;
}
Answer key
- padding
- space outside the border
- 202
- 324
- 106
- False
- 198
- 134
- 104
- 202
- 254
- 200
- 328
- 112
- 202
- 182
- the gap to other boxes
- 334
- padding
- 250
- 186
- the line round the box
- False
- False
- 306
- False
- 122
- 202
- content
- 186
- 162
- 166
- border
- True
- 214
- 216
- 126
- 66
- 122
- 200
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids