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: the content is the gap to other boxes. (a) True (b) False
- 2.Which of these is padding? (a) the line round the box (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
-
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: 140px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} - 4.True or false: the border is the line round the box. (a) False (b) True
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 15px;
border: 1px solid black;
margin: 0px;
} - 6.📦 In the box model, which part is the gap round content? (a) margin (b) padding (c) content (d) border
- 7.Which of these is the content? (a) the text or picture (b) the line round the box (c) the gap to other boxes (d) a solid or dotted edge
- 8.True or false: margin is the gap round content. (a) True (b) False
-
9.📦 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: 2px solid black;
margin: 20px;
} - 10.Which of these is margin? (a) the line round the box (b) the gap round content (c) a solid or dotted edge (d) space outside the border
- 11.Which of these is padding? (a) the line round the box (b) the gap round content (c) the gap to other boxes (d) space outside the border
- 12.📦 In the box model, which part is space inside the border? (a) margin (b) border (c) padding (d) content
-
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: 220px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} -
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: 120px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} - 15.True or false: padding is a solid or dotted edge. (a) True (b) False
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 15px;
border: 5px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 19.True or false: the content is the text or picture. (a) True (b) False
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
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: 290px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} - 26.📦 In the box model, which part is space outside the border? (a) padding (b) content (c) border (d) margin
- 27.True or false: padding is the gap round content. (a) False (b) True
-
28.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 50px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 29.True or false: the border is a solid or dotted edge. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
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: 50px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 33.Which of these is margin? (a) the line round the box (b) a solid or dotted edge (c) the gap to other boxes (d) the text or picture
- 34.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) content (d) border
-
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: 60px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} - 36.True or false: the content is a solid or dotted edge. (a) False (b) True
-
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 38.True or false: the content is the line round the box. (a) False (b) True
- 39.True or false: the content is the gap round content. (a) False (b) True
-
40.📦 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: 3px solid black;
margin: 0px;
}
Answer key
- False
- space inside the border
- 186
- True
- 182
- padding
- the text or picture
- False
- 94
- space outside the border
- the gap round content
- padding
- 268
- 146
- False
- 350
- 188
- 122
- True
- 124
- 162
- 230
- 258
- 280
- 330
- margin
- True
- 106
- True
- 334
- 96
- 190
- the gap to other boxes
- border
- 90
- False
- 330
- False
- False
- 286
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids