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.Which of these is the border? (a) the text or picture (b) the gap round content (c) the line round the box (d) the gap to other boxes
- 2.True or false: padding is the line round the box. (a) False (b) True
- 3.📦 In the box model, which part is a solid or dotted edge? (a) content (b) padding (c) border (d) margin
- 4.True or false: the content is space outside the border. (a) True (b) False
- 5.True or false: the border is space outside the border. (a) True (b) False
- 6.True or false: the content is the gap round content. (a) False (b) True
- 7.Which of these is margin? (a) the line round the box (b) the text or picture (c) the gap to other boxes (d) a solid or dotted edge
- 8.True or false: the border is the line round the box. (a) True (b) False
-
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
10.📦 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: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 13.Which of these is the content? (a) the gap round content (b) a solid or dotted edge (c) the gap to other boxes (d) the text or picture
-
14.📦 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: 15px;
border: 3px solid black;
margin: 20px;
} - 15.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) margin (d) content
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 18.True or false: the border is a solid or dotted edge. (a) True (b) False
- 19.📦 In the box model, which part is the gap to other boxes? (a) content (b) margin (c) padding (d) border
- 20.True or false: padding is space inside the border. (a) True (b) False
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} - 23.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) the text or picture (d) space outside the border
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 15px;
border: 5px solid black;
margin: 0px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
27.📦 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: 5px;
border: 5px solid black;
margin: 0px;
} -
28.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 130px;
padding: 30px;
border: 1px solid black;
margin: 20px;
} -
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 25px;
border: 1px solid black;
margin: 20px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
32.📦 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: 20px;
} -
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: 280px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} - 35.📦 In the box model, which part is space outside the border? (a) margin (b) border (c) content (d) padding
- 36.True or false: margin is the line round the box. (a) True (b) False
- 37.Which of these is padding? (a) space inside the border (b) the gap to other boxes (c) a solid or dotted edge (d) the line round the box
-
38.📦 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: 25px;
border: 5px solid black;
margin: 15px;
} -
39.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 20px;
border: 2px solid black;
margin: 10px;
}
Answer key
- the line round the box
- False
- border
- False
- False
- False
- the gap to other boxes
- True
- 182
- 232
- 258
- 220
- the text or picture
- 266
- border
- 202
- 140
- True
- margin
- True
- 274
- 112
- the gap round content
- 130
- 122
- 220
- 290
- 192
- 242
- 192
- 170
- 214
- 334
- 186
- margin
- False
- space inside the border
- 120
- 124
- 304
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids