← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 242
  2. margin
  3. 150
  4. False
  5. padding
  6. 156
  7. False
  8. 336
  9. False
  10. False
  11. 236
  12. the gap round content
  13. 162
  14. the text or picture
  15. 128
  16. the gap to other boxes
  17. 148
  18. True
  19. 134
  20. False
  21. 134
  22. False
  23. 172
  24. 198
  25. 202
  26. space outside the border
  27. margin
  28. 336
  29. 282
  30. 164
  31. border
  32. 322
  33. 204
  34. False
  35. 182
  36. 82
  37. space inside the border
  38. 252
  39. True
  40. True

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