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.Which of these is padding? (a) a solid or dotted edge (b) space inside the border (c) the line round the box (d) the text or picture
- 2.Which of these is padding? (a) space outside the border (b) the gap round content (c) the gap to other boxes (d) the text or picture
-
3.📦 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: 15px;
} - 4.True or false: padding is space inside the border. (a) True (b) False
-
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: 70px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 6.True or false: the content is the gap to other boxes. (a) True (b) False
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 8.Which of these is the border? (a) the line round the box (b) the gap round content (c) space outside the border (d) the text or picture
- 9.Which of these is margin? (a) the gap round content (b) space outside the border (c) the line round the box (d) the text or picture
-
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 14.True or false: the border is the line round the box. (a) False (b) True
- 15.True or false: margin is space outside the border. (a) False (b) True
- 16.📦 In the box model, which part is the gap to other boxes? (a) margin (b) border (c) padding (d) content
- 17.True or false: margin is a solid or dotted edge. (a) True (b) False
- 18.📦 In the box model, which part is the text or picture? (a) margin (b) padding (c) border (d) content
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
20.📦 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: 15px;
border: 4px solid black;
margin: 0px;
} - 21.True or false: the border is the gap round content. (a) True (b) False
- 22.Which of these is the border? (a) space outside the border (b) a solid or dotted edge (c) the text or picture (d) the gap round content
- 23.Which of these is the content? (a) the text or picture (b) space inside the border (c) space outside the border (d) the line round the box
- 24.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) padding (d) border
- 25.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) content (d) border
- 26.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) margin (c) border (d) content
- 27.True or false: the content is the text or picture. (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: 60px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
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: 110px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 25px;
border: 1px 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: 230px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
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: 270px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} -
33.📦 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: 15px;
} - 34.True or false: padding is the text or picture. (a) False (b) True
-
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: 70px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 20px;
border: 4px solid black;
margin: 20px;
} - 37.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 3px solid black;
margin: 0px;
}
Answer key
- space inside the border
- the gap round content
- 228
- True
- 140
- False
- 124
- the line round the box
- space outside the border
- 220
- 254
- 226
- 334
- True
- True
- margin
- False
- content
- 332
- 98
- False
- a solid or dotted edge
- the text or picture
- padding
- border
- border
- True
- 98
- 156
- 142
- 244
- 300
- 248
- False
- 88
- 138
- padding
- 234
- 124
- 246
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids