← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 176
  2. margin
  3. 170
  4. the text or picture
  5. 264
  6. a solid or dotted edge
  7. 194
  8. content
  9. False
  10. 84
  11. 76
  12. False
  13. True
  14. 302
  15. the gap round content
  16. True
  17. False
  18. 132
  19. 182
  20. border
  21. 352
  22. padding
  23. False
  24. False
  25. the gap to other boxes
  26. 204
  27. 202
  28. space inside the border
  29. 190
  30. True
  31. 242
  32. 230
  33. margin
  34. 236
  35. 184
  36. False
  37. 150
  38. the line round the box
  39. False
  40. 116

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