← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 188
  3. border
  4. margin
  5. 214
  6. 196
  7. False
  8. 206
  9. 334
  10. 74
  11. space outside the border
  12. 134
  13. margin
  14. 164
  15. 120
  16. 228
  17. 206
  18. 116
  19. 224
  20. the line round the box
  21. 206
  22. False
  23. border
  24. content
  25. 282
  26. 206
  27. 128
  28. 220
  29. 216
  30. padding
  31. 122
  32. the gap round content
  33. the text or picture
  34. 216
  35. 94
  36. padding
  37. 210
  38. 266
  39. 350
  40. 160

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