← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 152
  2. 144
  3. False
  4. the gap to other boxes
  5. 188
  6. True
  7. 150
  8. 124
  9. True
  10. False
  11. True
  12. 136
  13. a solid or dotted edge
  14. padding
  15. the line round the box
  16. 174
  17. 192
  18. 224
  19. 106
  20. 322
  21. the gap round content
  22. True
  23. content
  24. 82
  25. 112
  26. border
  27. 162
  28. 140
  29. 264
  30. 238
  31. margin
  32. 178
  33. 114
  34. 262
  35. False
  36. 94
  37. False
  38. 216
  39. space inside the border
  40. padding

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