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 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: 30px;
border: 3px solid black;
margin: 10px;
} - 2.True or false: the border is a solid or dotted edge. (a) True (b) False
- 3.True or false: margin is space inside the border. (a) True (b) False
-
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 5.Which of these is the content? (a) the gap round content (b) the text or picture (c) the line round the box (d) space outside the border
- 6.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) padding (d) content
- 7.True or false: margin is the gap to other boxes. (a) False (b) True
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 20px;
border: 2px solid black;
margin: 20px;
} -
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: 240px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} -
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: 260px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 12.True or false: margin is space outside the border. (a) False (b) True
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} - 14.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
-
15.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} - 16.True or false: the content is space inside the border. (a) False (b) True
- 17.Which of these is the border? (a) space outside the border (b) the line round the box (c) the gap round content (d) the gap to other boxes
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 19.📦 In the box model, which part is the text or picture? (a) border (b) content (c) padding (d) margin
-
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: 80px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} - 21.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) space outside the border (d) the gap round content
- 22.Which of these is padding? (a) the text or picture (b) space outside the border (c) the gap round content (d) the gap to other boxes
- 23.True or false: padding is the gap round content. (a) True (b) False
- 24.Which of these is the border? (a) the text or picture (b) space inside the border (c) the gap to other boxes (d) a solid or dotted edge
- 25.True or false: padding is space outside the border. (a) True (b) False
-
26.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 260px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 25px;
border: 5px 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: 5px;
border: 5px solid black;
margin: 15px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 31.True or false: the border is space inside the border. (a) True (b) False
- 32.True or false: margin is a solid or dotted edge. (a) True (b) False
- 33.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) content (c) border (d) padding
-
34.📦 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: 5px;
border: 5px solid black;
margin: 0px;
} - 35.True or false: the border is the gap round content. (a) True (b) False
- 36.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) the gap to other boxes (d) the gap round content
- 37.📦 In the box model, which part is the gap to other boxes? (a) content (b) margin (c) border (d) padding
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 10px;
border: 5px solid black;
margin: 20px;
} - 39.📦 In the box model, which part is space outside the border? (a) content (b) margin (c) padding (d) border
- 40.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
Answer key
- 316
- True
- False
- 192
- the text or picture
- padding
- True
- 144
- 290
- 282
- 216
- True
- 356
- padding
- 228
- False
- the line round the box
- 248
- content
- 94
- space outside the border
- the gap round content
- True
- a solid or dotted edge
- False
- 318
- 202
- 350
- 130
- 152
- False
- False
- border
- 70
- False
- the gap to other boxes
- margin
- 200
- margin
- border
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids