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 the gap round content? (a) border (b) content (c) margin (d) padding
- 2.True or false: the border is space inside the border. (a) True (b) False
- 3.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) margin (d) content
- 4.Which of these is padding? (a) space outside the border (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
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: 160px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 7.True or false: the border is space outside the border. (a) True (b) False
-
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 9.True or false: padding is the text or picture. (a) False (b) True
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} -
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: 250px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} - 13.📦 In the box model, which part is a solid or dotted edge? (a) content (b) border (c) padding (d) margin
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} - 15.True or false: padding is the gap to other boxes. (a) False (b) True
- 16.True or false: the content is the line round the box. (a) False (b) True
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 18.Which of these is margin? (a) a solid or dotted edge (b) the text or picture (c) space outside the border (d) the gap round content
-
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: 150px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 21.📦 In the box model, which part is space outside the border? (a) padding (b) border (c) content (d) margin
- 22.Which of these is margin? (a) space inside the border (b) the gap to other boxes (c) a solid or dotted edge (d) the line round the box
-
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: 200px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 5px;
border: 5px solid black;
margin: 5px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 10px;
border: 2px solid black;
margin: 10px;
} - 26.True or false: margin is space inside the border. (a) True (b) False
- 27.True or false: padding is the gap round content. (a) False (b) True
-
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} -
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: 200px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
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: 250px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 5px solid black;
margin: 0px;
} - 35.Which of these is the content? (a) space outside the border (b) the text or picture (c) space inside the border (d) a solid or dotted edge
-
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: 300px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 37.True or false: the content is the gap to other boxes. (a) True (b) False
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 40.📦 In the box model, which part is the line round the box? (a) content (b) border (c) padding (d) margin
Answer key
- padding
- False
- padding
- the gap round content
- 258
- 186
- False
- 142
- False
- 90
- 262
- 264
- border
- 232
- False
- False
- 242
- space outside the border
- 190
- 114
- margin
- the gap to other boxes
- 212
- 100
- 194
- False
- True
- 228
- 342
- 354
- 228
- 278
- 106
- 110
- the text or picture
- 344
- False
- 262
- 250
- border
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids