← The box model lesson New set →

CSS Worksheet: Box Model

HTML and CSS lesson 16: The box model · Set 296 · 40 questions
TalentJR

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. 1.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) margin (d) content
  2. 2.True or false: padding is the gap to other boxes. (a) False (b) True
  3. 3.Which of these is margin? (a) space inside the border (b) the text or picture (c) the gap round content (d) the gap to other boxes
  4. 4.True or false: margin is the text or picture. (a) True (b) False
  5. 5.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
  6. 6.Which of these is padding? (a) the gap round content (b) space outside the border (c) the line round the box (d) a solid or dotted edge
  7. 7.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 270px;
      padding: 20px;
      border: 4px solid black;
      margin: 10px;
    }
  8. 8.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 60px;
      padding: 10px;
      border: 4px solid black;
      margin: 15px;
    }
  9. 9.Which of these is padding? (a) the line round the box (b) space outside the border (c) a solid or dotted edge (d) space inside the border
  10. 10.True or false: padding is the line round the box. (a) True (b) False
  11. 11.📦 In the box model, which part is space inside the border? (a) margin (b) content (c) border (d) padding
  12. 12.Which of these is the content? (a) space inside the border (b) the line round the box (c) the text or picture (d) space outside the border
  13. 13.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 200px;
      padding: 30px;
      border: 1px solid black;
      margin: 5px;
    }
  14. 14.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) padding (d) border
  15. 15.📦 In the box model, which part is the gap to other boxes? (a) margin (b) padding (c) border (d) content
  16. 16.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 120px;
      padding: 30px;
      border: 2px solid black;
      margin: 5px;
    }
  17. 17.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 170px;
      padding: 10px;
      border: 2px solid black;
      margin: 10px;
    }
  18. 18.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 210px;
      padding: 5px;
      border: 3px solid black;
      margin: 0px;
    }
  19. 19.Which of these is margin? (a) the text or picture (b) the line round the box (c) a solid or dotted edge (d) space outside the border
  20. 20.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 100px;
      padding: 20px;
      border: 2px solid black;
      margin: 15px;
    }
  21. 21.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
  22. 22.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 160px;
      padding: 5px;
      border: 3px solid black;
      margin: 20px;
    }
  23. 23.📦 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: 30px;
      border: 3px solid black;
      margin: 5px;
    }
  24. 24.Which of these is the border? (a) the text or picture (b) the gap to other boxes (c) the line round the box (d) the gap round content
  25. 25.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 170px;
      padding: 15px;
      border: 4px solid black;
      margin: 20px;
    }
  26. 26.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 140px;
      padding: 30px;
      border: 1px solid black;
      margin: 15px;
    }
  27. 27.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 180px;
      padding: 30px;
      border: 5px solid black;
      margin: 0px;
    }
  28. 28.True or false: margin is the line round the box. (a) True (b) False
  29. 29.True or false: the border is a solid or dotted edge. (a) False (b) True
  30. 30.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 60px;
      padding: 5px;
      border: 3px solid black;
      margin: 20px;
    }
  31. 31.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) margin (d) content
  32. 32.True or false: the border is space outside the border. (a) True (b) False
  33. 33.True or false: margin is the gap round content. (a) True (b) False
  34. 34.True or false: margin is space inside the border. (a) True (b) False
  35. 35.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 80px;
      padding: 25px;
      border: 3px solid black;
      margin: 10px;
    }
  36. 36.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 70px;
      padding: 10px;
      border: 2px solid black;
      margin: 20px;
    }
  37. 37.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 210px;
      padding: 5px;
      border: 4px solid black;
      margin: 5px;
    }
  38. 38.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 170px;
      padding: 5px;
      border: 2px solid black;
      margin: 0px;
    }
  39. 39.True or false: the border is the text or picture. (a) True (b) False
  40. 40.True or false: padding is the gap round content. (a) False (b) True

Answer key

  1. padding
  2. False
  3. the gap to other boxes
  4. False
  5. border
  6. the gap round content
  7. 338
  8. 88
  9. space inside the border
  10. False
  11. padding
  12. the text or picture
  13. 272
  14. content
  15. margin
  16. 194
  17. 214
  18. 226
  19. space outside the border
  20. 174
  21. a solid or dotted edge
  22. 216
  23. 166
  24. the line round the box
  25. 248
  26. 232
  27. 250
  28. False
  29. True
  30. 116
  31. margin
  32. False
  33. False
  34. False
  35. 156
  36. 134
  37. 238
  38. 184
  39. False
  40. True

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids