← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 166
  2. 204
  3. 270
  4. a solid or dotted edge
  5. the text or picture
  6. 256
  7. 224
  8. 90
  9. margin
  10. 150
  11. 102
  12. content
  13. True
  14. 196
  15. space inside the border
  16. padding
  17. 290
  18. 168
  19. False
  20. 142
  21. 120
  22. 196
  23. space outside the border
  24. the gap to other boxes
  25. 144
  26. the gap round content
  27. False
  28. margin
  29. False
  30. 128
  31. 116
  32. border
  33. 366
  34. True
  35. True
  36. 250
  37. padding
  38. 164
  39. 314
  40. 194

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