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 to other boxes? (a) content (b) border (c) margin (d) padding
-
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: 260px;
padding: 10px;
border: 2px solid black;
margin: 20px;
} -
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
5.📦 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: 10px;
border: 5px solid black;
margin: 5px;
} -
6.📦 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: 15px;
border: 1px solid black;
margin: 0px;
} - 7.Which of these is the border? (a) the text or picture (b) a solid or dotted edge (c) the gap to other boxes (d) space inside the border
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} -
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: 50px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} -
10.📦 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: 4px solid black;
margin: 0px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} - 12.True or false: the content is the text or picture. (a) False (b) True
- 13.True or false: padding is the gap to other boxes. (a) True (b) False
-
14.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} -
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: 250px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 16.📦 In the box model, which part is space inside the border? (a) border (b) margin (c) padding (d) content
-
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 15px;
border: 3px solid black;
margin: 15px;
} - 18.Which of these is padding? (a) a solid or dotted edge (b) the text or picture (c) space outside the border (d) space inside the border
-
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} -
20.📦 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: 20px;
border: 4px solid black;
margin: 20px;
} - 21.Which of these is margin? (a) space inside the border (b) space outside the border (c) the text or picture (d) the line round the box
- 22.True or false: the content is space inside the border. (a) False (b) True
- 23.📦 In the box model, which part is the gap round content? (a) padding (b) content (c) border (d) margin
- 24.True or false: margin is the gap round content. (a) True (b) False
- 25.True or false: margin is space inside the border. (a) True (b) False
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 10px;
border: 3px solid black;
margin: 0px;
} - 27.True or false: the content is a solid or dotted edge. (a) True (b) False
- 28.Which of these is the border? (a) space inside the border (b) the text or picture (c) the line round the box (d) the gap to other boxes
-
29.📦 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: 10px;
border: 3px solid black;
margin: 10px;
} - 30.True or false: the border is a solid or dotted edge. (a) True (b) False
- 31.📦 In the box model, which part is space outside the border? (a) padding (b) margin (c) border (d) content
- 32.True or false: the content is the gap to other boxes. (a) False (b) True
-
33.📦 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: 5px solid black;
margin: 5px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
35.📦 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: 5px solid black;
margin: 5px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 15px;
border: 5px solid black;
margin: 10px;
} - 37.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) content (c) padding (d) border
- 38.True or false: padding is the gap round content. (a) False (b) True
- 39.True or false: margin is space outside the border. (a) True (b) False
- 40.Which of these is the content? (a) the gap round content (b) the text or picture (c) the gap to other boxes (d) space inside the border
Answer key
- margin
- 284
- 202
- 242
- 80
- 312
- a solid or dotted edge
- 112
- 66
- 308
- 264
- True
- False
- 184
- 318
- padding
- 326
- space inside the border
- 180
- 158
- space outside the border
- False
- padding
- False
- False
- 216
- False
- the line round the box
- 276
- True
- margin
- False
- 310
- 242
- 170
- 320
- border
- True
- True
- the text or picture
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids