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 top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} - 2.Which of these is the content? (a) space outside the border (b) the gap to other boxes (c) space inside the border (d) the text or picture
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} - 4.📦 In the box model, which part is space outside the border? (a) padding (b) margin (c) border (d) content
- 5.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) content (d) margin
-
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: 300px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 7.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) content (c) border (d) padding
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 9.Which of these is margin? (a) the line round the box (b) space outside the border (c) the text or picture (d) space inside the border
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} - 12.Which of these is the border? (a) a solid or dotted edge (b) the gap to other boxes (c) the text or picture (d) space outside the border
-
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 15.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
-
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: 150px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 17.📦 In the box model, which part is space inside the border? (a) border (b) margin (c) padding (d) content
- 18.True or false: the border is the text or picture. (a) True (b) False
-
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: 110px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
21.📦 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: 10px;
border: 4px solid black;
margin: 15px;
} -
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: 290px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 24.Which of these is padding? (a) the line round the box (b) space outside the border (c) the gap to other boxes (d) space inside the border
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 4px 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: 250px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 2px 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: 180px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
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: 90px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 5px solid black;
margin: 0px;
} - 32.True or false: padding is the gap to other boxes. (a) True (b) False
- 33.True or false: padding is space inside the border. (a) True (b) False
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} - 35.True or false: margin is the gap round content. (a) True (b) False
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 37.📦 In the box model, which part is the gap round content? (a) content (b) padding (c) border (d) margin
-
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: 150px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 39.True or false: the content is the text or picture. (a) True (b) False
- 40.Which of these is padding? (a) the line round the box (b) a solid or dotted edge (c) space outside the border (d) the gap round content
Answer key
- 146
- the text or picture
- 166
- margin
- border
- 364
- border
- 114
- space outside the border
- 206
- 134
- a solid or dotted edge
- 118
- 334
- content
- 174
- padding
- False
- 150
- 158
- 128
- 328
- 84
- space inside the border
- 192
- 118
- 282
- 344
- 232
- 148
- 160
- False
- True
- 110
- False
- 148
- padding
- 178
- True
- the gap round content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids