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.True or false: margin is the gap round content. (a) True (b) False
-
2.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 140px;
padding: 20px;
border: 1px solid black;
margin: 10px;
} - 3.📦 In the box model, which part is the gap round content? (a) border (b) margin (c) padding (d) content
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} -
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 1px solid black;
margin: 15px;
} - 6.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) border (d) margin
- 7.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) a solid or dotted edge (d) space inside the border
- 8.True or false: padding is space inside the border. (a) True (b) False
-
9.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 170px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} - 11.True or false: the content is the line round the box. (a) True (b) False
-
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 13.📦 In the box model, which part is the gap to other boxes? (a) border (b) padding (c) content (d) margin
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 15.Which of these is the content? (a) a solid or dotted edge (b) the gap to other boxes (c) the gap round content (d) the text or picture
-
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: 300px;
padding: 20px;
border: 1px solid black;
margin: 20px;
} - 17.Which of these is padding? (a) the gap to other boxes (b) the line round the box (c) space outside the border (d) the gap round content
- 18.📦 In the box model, which part is space inside the border? (a) padding (b) border (c) content (d) margin
- 19.📦 In the box model, which part is space outside the border? (a) padding (b) border (c) margin (d) content
-
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} - 21.True or false: the content is the text or picture. (a) True (b) False
-
22.📦 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: 15px;
border: 2px solid black;
margin: 20px;
} - 23.True or false: margin is space inside the border. (a) False (b) True
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 26.Which of these is the border? (a) the gap round content (b) space inside the border (c) the text or picture (d) the line round the box
- 27.📦 In the box model, which part is the text or picture? (a) content (b) border (c) padding (d) margin
-
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} - 29.True or false: the content is the gap round content. (a) False (b) True
- 30.True or false: margin is space outside the border. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 5px;
border: 2px solid black;
margin: 5px;
} -
32.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 34.Which of these is the border? (a) space outside the border (b) a solid or dotted edge (c) the gap round content (d) the text or picture
-
35.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
36.📦 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: 20px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 1px solid black;
margin: 0px;
} - 38.True or false: margin is the text or picture. (a) False (b) True
- 39.True or false: padding is space outside the border. (a) True (b) False
- 40.True or false: margin is the gap to other boxes. (a) False (b) True
Answer key
- False
- 182
- padding
- 248
- 142
- border
- space inside the border
- True
- 184
- 336
- False
- 296
- margin
- 254
- the text or picture
- 342
- the gap round content
- padding
- margin
- 216
- True
- 134
- False
- 152
- 310
- the line round the box
- content
- 198
- False
- True
- 204
- 184
- 224
- a solid or dotted edge
- 152
- 242
- 322
- False
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids