← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. border
  3. 322
  4. padding
  5. False
  6. the gap round content
  7. 288
  8. 244
  9. 172
  10. False
  11. the line round the box
  12. 140
  13. space inside the border
  14. space outside the border
  15. 180
  16. 82
  17. 180
  18. 262
  19. 94
  20. 330
  21. the text or picture
  22. False
  23. 92
  24. margin
  25. 302
  26. 112
  27. True
  28. 74
  29. padding
  30. 364
  31. 278
  32. 116
  33. False
  34. True
  35. 334
  36. False
  37. 246
  38. 168
  39. 272
  40. 160

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