← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 236
  3. False
  4. False
  5. the text or picture
  6. the gap round content
  7. False
  8. 174
  9. a solid or dotted edge
  10. 330
  11. True
  12. 368
  13. padding
  14. 316
  15. True
  16. content
  17. 224
  18. True
  19. True
  20. 66
  21. True
  22. 252
  23. 244
  24. 198
  25. 156
  26. margin
  27. True
  28. 166
  29. 354
  30. 94
  31. 136
  32. 212
  33. 362
  34. 144
  35. margin
  36. 110
  37. False
  38. 232
  39. 210
  40. 72

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