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.True or false: the content is the gap round content. (a) True (b) False
-
2.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} -
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 15px;
border: 2px solid black;
margin: 0px;
} - 5.True or false: padding is the gap round content. (a) True (b) False
- 6.Which of these is the content? (a) a solid or dotted edge (b) the gap round content (c) space inside the border (d) the text or picture
- 7.📦 In the box model, which part is the gap round content? (a) border (b) content (c) padding (d) margin
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 9.True or false: the border is a solid or dotted edge. (a) True (b) False
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} - 14.True or false: padding is space outside the border. (a) False (b) True
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 2px solid black;
margin: 20px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 18.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) border (c) margin (d) content
- 19.📦 In the box model, which part is the gap to other boxes? (a) padding (b) border (c) margin (d) content
- 20.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) margin (d) border
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} - 22.True or false: padding is the text or picture. (a) False (b) True
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
25.📦 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: 30px;
border: 3px solid black;
margin: 20px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
28.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 25px;
border: 5px solid black;
margin: 15px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} - 30.True or false: the border is space inside the border. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 32.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) border (d) content
- 33.True or false: the content is the line round the box. (a) False (b) True
- 34.True or false: margin is the gap to other boxes. (a) True (b) False
- 35.📦 In the box model, which part is space outside the border? (a) content (b) padding (c) border (d) margin
- 36.True or false: the border is the line round the box. (a) True (b) False
- 37.Which of these is padding? (a) space outside the border (b) the gap round content (c) the text or picture (d) the gap to other boxes
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
39.📦 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: 30px;
border: 1px solid black;
margin: 20px;
} - 40.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) margin (d) content
Answer key
- False
- 248
- 142
- 274
- True
- the text or picture
- padding
- 122
- True
- 114
- 108
- 126
- 190
- False
- 192
- 204
- 290
- border
- margin
- padding
- 192
- False
- 272
- 224
- 226
- 156
- 204
- 300
- 252
- False
- 168
- border
- False
- True
- margin
- True
- the gap round content
- 160
- 292
- content
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids