← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. space outside the border
  3. True
  4. False
  5. True
  6. True
  7. True
  8. True
  9. False
  10. 118
  11. 314
  12. border
  13. 354
  14. 82
  15. padding
  16. 112
  17. 134
  18. margin
  19. the gap to other boxes
  20. False
  21. 108
  22. 128
  23. border
  24. False
  25. the text or picture
  26. False
  27. 228
  28. 170
  29. 286
  30. 118
  31. 84
  32. False
  33. 242
  34. 112
  35. the line round the box
  36. False
  37. space inside the border
  38. 54
  39. 122
  40. 176

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