← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 82
  3. True
  4. padding
  5. 332
  6. padding
  7. True
  8. the text or picture
  9. 126
  10. 114
  11. border
  12. 390
  13. the gap to other boxes
  14. a solid or dotted edge
  15. 206
  16. 314
  17. 124
  18. 64
  19. 116
  20. border
  21. 206
  22. 112
  23. 312
  24. 244
  25. space inside the border
  26. 138
  27. the gap round content
  28. 242
  29. False
  30. 312
  31. 300
  32. 160
  33. 178
  34. 118
  35. 102
  36. 296
  37. 278
  38. space outside the border
  39. True
  40. 62

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