← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. padding
  3. 224
  4. 346
  5. 150
  6. 92
  7. 302
  8. 248
  9. the text or picture
  10. 130
  11. margin
  12. 200
  13. 80
  14. 122
  15. False
  16. False
  17. False
  18. content
  19. 112
  20. False
  21. border
  22. 120
  23. 262
  24. 186
  25. 356
  26. space outside the border
  27. the line round the box
  28. 86
  29. 228
  30. a solid or dotted edge
  31. 192
  32. False
  33. 118
  34. margin
  35. 122
  36. 64
  37. 256
  38. 120
  39. True
  40. 128

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