← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. padding
  3. 356
  4. space outside the border
  5. False
  6. the text or picture
  7. the gap to other boxes
  8. 202
  9. border
  10. 230
  11. padding
  12. True
  13. 152
  14. margin
  15. 132
  16. 302
  17. space inside the border
  18. 216
  19. 212
  20. 136
  21. 350
  22. border
  23. 166
  24. margin
  25. 216
  26. True
  27. 132
  28. a solid or dotted edge
  29. 198
  30. 164
  31. the line round the box
  32. 276
  33. 150
  34. 212
  35. content
  36. 250
  37. 124
  38. True
  39. 90
  40. the gap round content

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