← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 222
  2. a solid or dotted edge
  3. 314
  4. False
  5. margin
  6. padding
  7. 198
  8. the gap round content
  9. 82
  10. the text or picture
  11. 272
  12. 224
  13. False
  14. 222
  15. margin
  16. 242
  17. border
  18. 250
  19. the line round the box
  20. True
  21. space outside the border
  22. 158
  23. 112
  24. 160
  25. 196
  26. False
  27. 262
  28. 98
  29. False
  30. 244
  31. False
  32. border
  33. 118
  34. 210
  35. 164
  36. 122
  37. False
  38. 266
  39. False
  40. False

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