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 padding? (a) the gap to other boxes (b) a solid or dotted edge (c) space inside the border (d) space outside the border
- 2.Which of these is the border? (a) the gap round content (b) space outside the border (c) the line round the box (d) the gap to other boxes
-
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: 110px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
4.📦 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: 20px;
border: 1px solid black;
margin: 0px;
} -
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} - 6.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) margin (d) content
- 7.Which of these is the content? (a) the text or picture (b) the gap to other boxes (c) space inside the border (d) a solid or dotted edge
- 8.Which of these is margin? (a) space inside the border (b) the gap round content (c) the line round the box (d) space outside the border
- 9.True or false: margin is the gap round content. (a) True (b) False
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 11.📦 In the box model, which part is the line round the box? (a) margin (b) padding (c) content (d) border
- 12.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) margin (c) content (d) border
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 20px;
border: 5px solid black;
margin: 20px;
} - 14.True or false: the content is the line round the box. (a) False (b) True
- 15.True or false: the content is space inside the border. (a) True (b) False
- 16.True or false: padding is the text or picture. (a) True (b) False
- 17.📦 In the box model, which part is the text or picture? (a) margin (b) padding (c) content (d) border
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 19.True or false: the content is the gap to other boxes. (a) True (b) False
- 20.True or false: padding is the gap round content. (a) True (b) False
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
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: 120px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} -
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 25.Which of these is padding? (a) space outside the border (b) the text or picture (c) the gap round content (d) a solid or dotted edge
- 26.True or false: the border is a solid or dotted edge. (a) False (b) True
-
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 30px;
border: 4px solid black;
margin: 5px;
} - 28.True or false: the border is the gap to other boxes. (a) False (b) True
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} -
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: 220px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 31.True or false: the content is space outside the border. (a) True (b) False
-
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: 220px;
padding: 25px;
border: 1px solid black;
margin: 5px;
} - 33.📦 In the box model, which part is the gap round content? (a) content (b) margin (c) border (d) padding
-
34.📦 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: 30px;
border: 5px solid black;
margin: 15px;
} - 35.Which of these is the border? (a) the gap to other boxes (b) the gap round content (c) space outside 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: 280px;
padding: 30px;
border: 3px solid black;
margin: 20px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 4px solid black;
margin: 0px;
} -
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: 100px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 10px;
border: 3px solid black;
margin: 10px;
}
Answer key
- space inside the border
- the line round the box
- 148
- 252
- 78
- padding
- the text or picture
- space outside the border
- False
- 70
- border
- border
- 230
- False
- False
- False
- content
- 200
- False
- True
- 120
- 224
- 164
- 208
- the gap round content
- True
- 128
- False
- 332
- 276
- False
- 272
- padding
- 320
- a solid or dotted edge
- 346
- 246
- 228
- 120
- 186
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids