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: 170px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 2.True or false: padding is space outside the border. (a) True (b) False
-
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: 240px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} - 5.True or false: the border is the text or picture. (a) False (b) True
-
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: 210px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 7.True or false: the border is the line round the box. (a) False (b) True
- 8.📦 In the box model, which part is the text or picture? (a) margin (b) border (c) content (d) padding
-
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: 210px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 10.Which of these is padding? (a) the text or picture (b) a solid or dotted edge (c) space inside the border (d) the gap to other boxes
-
11.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} - 13.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 20px;
border: 5px solid black;
margin: 15px;
} -
17.📦 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: 20px;
border: 2px solid black;
margin: 5px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 19.📦 In the box model, which part is the gap round content? (a) margin (b) padding (c) content (d) border
- 20.Which of these is the content? (a) space outside the border (b) the text or picture (c) the gap to other boxes (d) a solid or dotted edge
-
21.📦 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: 30px;
border: 5px solid black;
margin: 20px;
} - 22.True or false: padding is the gap to other boxes. (a) False (b) True
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 24.True or false: the content is the text or picture. (a) False (b) True
- 25.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
-
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: 250px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} - 27.True or false: padding is the gap round content. (a) True (b) False
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} - 29.True or false: the content is space inside the border. (a) True (b) False
- 30.True or false: the border is space inside the border. (a) True (b) False
-
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: 5px;
border: 2px solid black;
margin: 10px;
} - 32.📦 In the box model, which part is space inside the border? (a) margin (b) border (c) content (d) padding
-
33.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 90px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 37.Which of these is the border? (a) space outside the border (b) the gap round content (c) space inside the border (d) the line round the box
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 40.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) the text or picture (d) the gap round content
Answer key
- 198
- False
- 254
- 194
- False
- 280
- True
- content
- 232
- space inside the border
- 190
- 368
- the gap to other boxes
- 242
- 310
- 180
- 104
- 148
- padding
- the text or picture
- 340
- False
- 216
- True
- border
- 276
- True
- 196
- False
- False
- 64
- padding
- 108
- 76
- 248
- 164
- the line round the box
- 192
- 192
- the gap round content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids