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: 60px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} - 2.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
- 3.True or false: the content is the gap to other boxes. (a) True (b) False
- 4.True or false: padding is the text or picture. (a) True (b) False
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 6.True or false: the content is the text or picture. (a) False (b) True
- 7.Which of these is the content? (a) space inside the border (b) the text or picture (c) the gap round content (d) the line round the box
-
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: 270px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 10.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) space outside the border (d) the line round the box
-
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
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: 60px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} - 13.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) border (d) content
- 14.📦 In the box model, which part is space inside the border? (a) border (b) content (c) margin (d) padding
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 16.Which of these is margin? (a) space inside the border (b) space outside the border (c) the gap round content (d) a solid or dotted edge
- 17.True or false: the border is the line round the box. (a) False (b) True
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} -
19.📦 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: 10px;
border: 1px solid black;
margin: 10px;
} -
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: 300px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} - 21.📦 In the box model, which part is space outside the border? (a) content (b) padding (c) margin (d) border
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 4px solid black;
margin: 10px;
} -
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: 270px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 24.True or false: the border is a solid or dotted edge. (a) True (b) False
- 25.📦 In the box model, which part is a solid or dotted edge? (a) content (b) padding (c) margin (d) border
- 26.True or false: margin is a solid or dotted edge. (a) True (b) False
- 27.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) padding (d) border
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 29.True or false: margin is the gap round content. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} - 33.True or false: padding is the line round the box. (a) True (b) False
-
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} -
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: 50px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 36.Which of these is the border? (a) the text or picture (b) the gap round content (c) space inside the border (d) the line round the box
- 37.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) the line round the box (d) the gap to other boxes
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 40.True or false: margin is space outside the border. (a) True (b) False
Answer key
- 124
- padding
- False
- False
- 236
- True
- the text or picture
- 328
- 342
- the gap round content
- 214
- 122
- content
- padding
- 258
- space outside the border
- True
- 248
- 102
- 362
- margin
- 368
- 294
- True
- border
- False
- border
- 168
- False
- 234
- 146
- 180
- False
- 242
- 80
- the line round the box
- the gap to other boxes
- 100
- 178
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids