← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap to other boxes
  2. border
  3. 322
  4. False
  5. 224
  6. 122
  7. False
  8. space inside the border
  9. 256
  10. the line round the box
  11. the text or picture
  12. True
  13. 310
  14. 270
  15. True
  16. 158
  17. padding
  18. False
  19. 196
  20. margin
  21. False
  22. border
  23. the gap round content
  24. 272
  25. False
  26. 220
  27. True
  28. 194
  29. 154
  30. 212
  31. 354
  32. True
  33. 214
  34. space outside the border
  35. False
  36. 76
  37. False
  38. 206
  39. 194
  40. 154

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