← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 174
  2. border
  3. False
  4. 208
  5. 134
  6. margin
  7. True
  8. 148
  9. the gap round content
  10. the gap to other boxes
  11. False
  12. 228
  13. False
  14. space outside the border
  15. space inside the border
  16. 264
  17. padding
  18. padding
  19. 230
  20. margin
  21. 170
  22. False
  23. 208
  24. 322
  25. 170
  26. the text or picture
  27. 226
  28. 254
  29. 136
  30. 260
  31. 358
  32. the line round the box
  33. 110
  34. True
  35. border
  36. False
  37. 182
  38. 214
  39. True
  40. True

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