← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 102
  2. 68
  3. 202
  4. True
  5. True
  6. 184
  7. padding
  8. 196
  9. space inside the border
  10. the gap to other boxes
  11. 96
  12. 100
  13. True
  14. a solid or dotted edge
  15. margin
  16. False
  17. False
  18. False
  19. the text or picture
  20. 110
  21. padding
  22. 150
  23. 250
  24. 124
  25. 280
  26. 134
  27. 164
  28. 174
  29. the gap round content
  30. 80
  31. 112
  32. True
  33. False
  34. border
  35. False
  36. False
  37. 308
  38. 346
  39. 208
  40. content

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