← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. padding
  3. 122
  4. 250
  5. 188
  6. margin
  7. border
  8. the gap round content
  9. the gap to other boxes
  10. 216
  11. True
  12. False
  13. 160
  14. content
  15. space inside the border
  16. False
  17. 316
  18. 174
  19. 212
  20. padding
  21. 162
  22. 268
  23. False
  24. 212
  25. 94
  26. 322
  27. 232
  28. 278
  29. 202
  30. 152
  31. margin
  32. 100
  33. False
  34. True
  35. 182
  36. 168
  37. 242
  38. 244
  39. space outside the border
  40. 132

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