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) margin (c) content (d) padding
-
2.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 3px solid black;
margin: 20px;
} -
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: 210px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
4.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} - 5.Which of these is padding? (a) space outside the border (b) the gap to other boxes (c) space inside the border (d) the line round the box
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} -
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 3px solid black;
margin: 15px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} -
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 15.Which of these is the content? (a) space inside the border (b) the gap round content (c) the gap to other boxes (d) the text or picture
-
16.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} -
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: 260px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} - 18.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 20.Which of these is margin? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) a solid or dotted edge
- 21.True or false: padding is space inside the border. (a) True (b) False
- 22.True or false: the border is the line round the box. (a) True (b) False
- 23.True or false: margin is the gap round content. (a) True (b) False
- 24.📦 In the box model, which part is space outside the border? (a) content (b) border (c) padding (d) margin
-
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: 240px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} - 26.📦 In the box model, which part is space inside the border? (a) content (b) border (c) margin (d) padding
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 2px solid black;
margin: 20px;
} - 28.Which of these is the border? (a) the text or picture (b) space inside the border (c) a solid or dotted edge (d) the gap to other boxes
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} -
30.📦 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: 5px;
border: 5px solid black;
margin: 0px;
} - 31.True or false: margin is space inside the border. (a) True (b) False
- 32.📦 In the box model, which part is the gap to other boxes? (a) border (b) content (c) padding (d) margin
-
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 5px solid black;
margin: 15px;
} - 35.True or false: padding is the text or picture. (a) False (b) True
-
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: 160px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 37.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) space outside the border (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: 280px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
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: 260px;
padding: 25px;
border: 4px solid black;
margin: 20px;
} -
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 2px solid black;
margin: 10px;
}
Answer key
- padding
- 326
- 240
- 184
- space inside the border
- 226
- 182
- 226
- 358
- 304
- 276
- 208
- 192
- 132
- the text or picture
- 196
- 302
- border
- 304
- the gap to other boxes
- True
- True
- False
- margin
- 290
- padding
- 354
- a solid or dotted edge
- 122
- 170
- False
- margin
- 324
- 130
- False
- 198
- the gap round content
- 324
- 318
- 244
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids