← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. content
  3. 244
  4. 226
  5. 114
  6. a solid or dotted edge
  7. 166
  8. False
  9. 302
  10. 192
  11. 250
  12. 106
  13. 106
  14. space outside the border
  15. 266
  16. 184
  17. 270
  18. the text or picture
  19. the line round the box
  20. 132
  21. 166
  22. 214
  23. space inside the border
  24. 306
  25. padding
  26. 130
  27. 112
  28. False
  29. 66
  30. False
  31. 356
  32. border
  33. 80
  34. True
  35. 218
  36. 332
  37. border
  38. 214
  39. 246
  40. padding

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