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 outside the border? (a) padding (b) margin (c) content (d) border
- 2.📦 In the box model, which part is the line round the box? (a) margin (b) padding (c) border (d) content
- 3.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) padding (c) border (d) content
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} - 5.True or false: padding is space inside the border. (a) True (b) False
-
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: 50px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
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: 250px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
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: 70px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
11.📦 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: 0px;
} - 12.True or false: margin is space outside the border. (a) False (b) True
- 13.Which of these is margin? (a) the text or picture (b) space outside the border (c) space inside the border (d) a solid or dotted edge
-
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: 25px;
border: 4px solid black;
margin: 0px;
} - 15.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) margin (d) content
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 5px solid black;
margin: 5px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} - 19.True or false: the content is the line round the box. (a) False (b) True
- 20.Which of these is padding? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap to other boxes
-
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 30px;
border: 2px solid black;
margin: 20px;
} -
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: 80px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} -
24.📦 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: 30px;
border: 2px solid black;
margin: 10px;
} - 25.📦 In the box model, which part is the gap round content? (a) content (b) border (c) padding (d) margin
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 28.Which of these is the border? (a) the line round the box (b) space outside the border (c) space inside the border (d) the gap round content
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} - 30.True or false: the border is space inside the border. (a) True (b) False
- 31.📦 In the box model, which part is the gap to other boxes? (a) content (b) margin (c) border (d) padding
-
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} -
36.📦 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: 30px;
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: 130px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} - 38.Which of these is the content? (a) the text or picture (b) the line round the box (c) space inside the border (d) the gap to other boxes
- 39.True or false: the border is the text or picture. (a) False (b) True
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 4px solid black;
margin: 0px;
}
Answer key
- margin
- border
- border
- 362
- True
- 102
- 284
- 98
- 102
- 254
- 106
- True
- space outside the border
- 178
- content
- 170
- 106
- 132
- False
- space inside the border
- 122
- 194
- 114
- 124
- padding
- 316
- 174
- the line round the box
- 190
- False
- margin
- 84
- 386
- 100
- 110
- 124
- 186
- the text or picture
- False
- 198
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids