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 margin? (a) space inside the border (b) space outside the border (c) the text or picture (d) a solid or dotted edge
- 2.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) padding (d) border
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 3px solid black;
margin: 10px;
} -
4.📦 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: 5px;
border: 1px solid black;
margin: 20px;
} -
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: 120px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 6.Which of these is the content? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap round content
-
7.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
8.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} -
9.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} - 10.True or false: margin is the line round the box. (a) True (b) False
-
11.📦 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: 20px;
border: 5px solid black;
margin: 20px;
} - 12.True or false: margin is space outside the border. (a) False (b) True
-
13.📦 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: 30px;
border: 1px solid black;
margin: 20px;
} - 14.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
- 15.True or false: margin is the gap to other boxes. (a) True (b) False
- 16.True or false: padding is space inside the border. (a) False (b) True
- 17.True or false: padding is space outside the border. (a) False (b) True
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 19.Which of these is padding? (a) space outside the border (b) the gap to other boxes (c) the gap round content (d) the text or picture
- 20.Which of these is padding? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 21.True or false: padding is the text or picture. (a) True (b) False
- 22.True or false: the border is space outside the border. (a) False (b) True
- 23.True or false: the border is the line round the box. (a) False (b) True
- 24.True or false: the content is the gap to other boxes. (a) True (b) False
-
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} - 26.📦 In the box model, which part is the gap to other boxes? (a) padding (b) content (c) border (d) margin
- 27.True or false: padding is a solid or dotted edge. (a) True (b) False
-
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: 130px;
padding: 30px;
border: 3px solid black;
margin: 15px;
} - 29.True or false: margin is a solid or dotted edge. (a) True (b) False
-
30.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 32.True or false: the content is space inside the border. (a) True (b) False
-
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 25px;
border: 2px solid black;
margin: 20px;
} - 36.Which of these is the border? (a) space inside the border (b) the text or picture (c) the gap round content (d) a solid or dotted edge
- 37.True or false: padding is the gap to other boxes. (a) True (b) False
-
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 30px;
border: 4px solid black;
margin: 15px;
} - 39.📦 In the box model, which part is the line round the box? (a) content (b) margin (c) border (d) padding
-
40.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 280px;
padding: 20px;
border: 1px solid black;
margin: 5px;
}
Answer key
- space outside the border
- content
- 166
- 282
- 136
- the text or picture
- 144
- 290
- 348
- False
- 320
- True
- 202
- border
- True
- True
- False
- 176
- the gap round content
- space inside the border
- False
- False
- True
- False
- 96
- margin
- False
- 196
- False
- 318
- 286
- False
- 182
- 146
- 374
- a solid or dotted edge
- False
- 378
- border
- 332
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids