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 space inside the border. (a) False (b) True
- 2.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) border (d) margin
-
3.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
5.📦 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: 30px;
border: 5px solid black;
margin: 15px;
} -
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 9.Which of these is the content? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap round content
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} - 11.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) border (d) content
-
12.📦 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: 0px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
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: 90px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 15.True or false: the border is space outside the border. (a) False (b) True
- 16.True or false: the content is a solid or dotted edge. (a) False (b) True
- 17.True or false: padding is the text or picture. (a) True (b) False
- 18.📦 In the box model, which part is the text or picture? (a) border (b) content (c) margin (d) padding
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} - 20.True or false: the content is space inside the border. (a) False (b) True
- 21.📦 In the box model, which part is a solid or dotted edge? (a) content (b) border (c) margin (d) padding
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
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: 200px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
25.📦 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: 25px;
border: 3px solid black;
margin: 10px;
} - 26.Which of these is margin? (a) the gap round content (b) space inside the border (c) the line round the box (d) space outside the border
- 27.Which of these is the border? (a) the line round the box (b) the gap round content (c) space inside the border (d) the text or picture
-
28.📦 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: 10px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} - 30.Which of these is the border? (a) space inside the border (b) the text or picture (c) a solid or dotted edge (d) space outside the border
-
31.📦 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: 10px;
} - 32.True or false: the content is the line round the box. (a) True (b) False
-
33.📦 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: 5px;
border: 4px solid black;
margin: 10px;
} - 34.📦 In the box model, which part is the gap to other boxes? (a) padding (b) border (c) margin (d) content
-
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: 110px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} -
37.📦 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: 10px;
border: 3px solid black;
margin: 5px;
} -
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: 80px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} - 39.True or false: margin is the gap to other boxes. (a) False (b) True
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 20px;
border: 4px solid black;
margin: 15px;
}
Answer key
- True
- padding
- 224
- 346
- 150
- 92
- 302
- 248
- the text or picture
- 130
- margin
- 200
- 80
- 122
- False
- False
- False
- content
- 112
- False
- border
- 120
- 262
- 186
- 356
- space outside the border
- the line round the box
- 86
- 228
- a solid or dotted edge
- 192
- False
- 118
- margin
- 122
- 64
- 256
- 120
- True
- 128
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids