← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 220
  2. padding
  3. the line round the box
  4. False
  5. 122
  6. 192
  7. False
  8. 152
  9. 322
  10. border
  11. False
  12. margin
  13. False
  14. 90
  15. 68
  16. content
  17. a solid or dotted edge
  18. False
  19. False
  20. 202
  21. 238
  22. True
  23. padding
  24. 306
  25. border
  26. 302
  27. True
  28. space outside the border
  29. 204
  30. the text or picture
  31. 212
  32. False
  33. False
  34. 338
  35. margin
  36. 190
  37. False
  38. 312
  39. space inside the border
  40. 122

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