← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. False
  3. False
  4. the gap to other boxes
  5. a solid or dotted edge
  6. 302
  7. the gap round content
  8. padding
  9. True
  10. False
  11. 204
  12. 176
  13. 336
  14. 368
  15. the text or picture
  16. 232
  17. 196
  18. space outside the border
  19. 134
  20. 196
  21. 98
  22. 108
  23. False
  24. the line round the box
  25. border
  26. 248
  27. 162
  28. 144
  29. padding
  30. 190
  31. 272
  32. 288
  33. 154
  34. space inside the border
  35. 208
  36. 150
  37. 240
  38. 334
  39. 276
  40. 82

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