← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. True
  3. margin
  4. 126
  5. 196
  6. the gap to other boxes
  7. True
  8. 134
  9. False
  10. space inside the border
  11. False
  12. a solid or dotted edge
  13. 242
  14. 162
  15. 230
  16. 206
  17. 168
  18. padding
  19. True
  20. space outside the border
  21. True
  22. 102
  23. 208
  24. 192
  25. True
  26. 162
  27. 302
  28. the line round the box
  29. 190
  30. 174
  31. False
  32. 136
  33. 222
  34. padding
  35. 96
  36. 102
  37. False
  38. the text or picture
  39. 376
  40. 100

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