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.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 2.Which of these is padding? (a) the text or picture (b) a solid or dotted edge (c) space inside the border (d) the line round the box
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} - 4.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
- 5.True or false: padding is a solid or dotted edge. (a) False (b) True
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} - 7.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) padding (d) border
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 9.Which of these is the content? (a) the gap round content (b) a solid or dotted edge (c) space inside the border (d) the text or picture
- 10.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) border (d) margin
- 11.📦 In the box model, which part is the line round the box? (a) border (b) content (c) margin (d) padding
- 12.True or false: margin is space inside the border. (a) True (b) False
- 13.Which of these is padding? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the text or picture
- 14.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
15.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 90px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
16.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 180px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 17.Which of these is margin? (a) the gap to other boxes (b) the gap round content (c) space inside the border (d) the line round the box
-
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 1px solid black;
margin: 15px;
} - 20.True or false: padding is space inside the border. (a) False (b) True
- 21.True or false: padding is the gap round content. (a) False (b) True
- 22.Which of these is the border? (a) the line round the box (b) the gap to other boxes (c) the gap round content (d) space inside the border
-
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: 160px;
padding: 10px;
border: 3px solid black;
margin: 5px;
} -
24.📦 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: 10px;
border: 5px solid black;
margin: 20px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 50px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} - 26.True or false: the content is space outside the border. (a) True (b) False
- 27.📦 In the box model, which part is the gap round content? (a) margin (b) padding (c) border (d) content
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 29.True or false: the content is the line round the box. (a) True (b) False
-
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: 200px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 31.True or false: the content is the gap to other boxes. (a) False (b) True
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
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: 150px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} - 37.True or false: margin is a solid or dotted edge. (a) False (b) True
-
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: 260px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} -
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: 280px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} - 40.Which of these is margin? (a) space inside the border (b) a solid or dotted edge (c) the line round the box (d) space outside the border
Answer key
- 106
- space inside the border
- 110
- margin
- False
- 182
- padding
- 354
- the text or picture
- margin
- border
- False
- the gap round content
- a solid or dotted edge
- 102
- 240
- the gap to other boxes
- 264
- 302
- True
- True
- the line round the box
- 186
- 300
- 120
- False
- padding
- 96
- False
- 268
- False
- 182
- 344
- 354
- 122
- 212
- False
- 314
- 306
- space outside the border
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids