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 space inside the border? (a) padding (b) content (c) border (d) margin
- 2.📦 In the box model, which part is the gap round content? (a) margin (b) padding (c) border (d) content
- 3.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
- 4.True or false: the content is the text or picture. (a) False (b) True
- 5.Which of these is the border? (a) the gap to other boxes (b) the gap round content (c) the line round the box (d) the text or picture
-
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: 150px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 7.Which of these is padding? (a) space outside the border (b) the line round the box (c) a solid or dotted edge (d) the gap round content
-
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 25px;
border: 1px solid black;
margin: 10px;
} -
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: 160px;
padding: 5px;
border: 1px solid black;
margin: 0px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
12.📦 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: 20px;
border: 2px solid black;
margin: 20px;
} - 13.True or false: the border is the gap to other boxes. (a) False (b) True
- 14.True or false: margin is space inside the border. (a) False (b) True
-
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 130px;
padding: 20px;
border: 5px solid black;
margin: 0px;
} - 16.📦 In the box model, which part is the text or picture? (a) border (b) content (c) padding (d) margin
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} - 18.Which of these is padding? (a) space outside the border (b) space inside the border (c) the line round the box (d) the gap to other boxes
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 25px;
border: 2px solid black;
margin: 0px;
} - 21.True or false: padding is the text or picture. (a) True (b) False
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 23.Which of these is margin? (a) a solid or dotted edge (b) space inside the border (c) the gap to other boxes (d) the text or picture
- 24.📦 In the box model, which part is space outside the border? (a) padding (b) border (c) content (d) margin
-
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: 50px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} - 26.Which of these is the content? (a) the gap to other boxes (b) the gap round content (c) the text or picture (d) a solid or dotted edge
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} -
28.📦 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: 1px solid black;
margin: 20px;
} - 29.📦 In the box model, which part is the line round the box? (a) margin (b) padding (c) content (d) border
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 32.True or false: padding is the gap round content. (a) True (b) False
- 33.True or false: the content is the gap round content. (a) True (b) False
-
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: 190px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} - 35.Which of these is margin? (a) space outside the border (b) the text or picture (c) the line round the box (d) the gap round content
-
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: 180px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} - 37.True or false: margin is the gap round content. (a) True (b) False
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} - 39.True or false: the content is space inside the border. (a) False (b) True
- 40.True or false: the border is the line round the box. (a) True (b) False
Answer key
- padding
- padding
- border
- True
- the line round the box
- 182
- the gap round content
- 316
- 272
- 172
- 98
- 224
- False
- False
- 180
- content
- 254
- space inside the border
- 324
- 94
- False
- 172
- the gap to other boxes
- margin
- 80
- the text or picture
- 260
- 112
- border
- 310
- 358
- True
- False
- 248
- space outside the border
- 204
- False
- 190
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids