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