← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 130
  3. space outside the border
  4. padding
  5. the text or picture
  6. 302
  7. 222
  8. True
  9. False
  10. False
  11. 140
  12. border
  13. margin
  14. 128
  15. a solid or dotted edge
  16. 248
  17. 180
  18. 294
  19. the gap round content
  20. 318
  21. False
  22. False
  23. 168
  24. 210
  25. 182
  26. True
  27. 224
  28. 250
  29. content
  30. True
  31. True
  32. margin
  33. 162
  34. 112
  35. True
  36. False
  37. 84
  38. 314
  39. 132
  40. False

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