← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 164
  2. 80
  3. 308
  4. 140
  5. space inside the border
  6. True
  7. True
  8. padding
  9. 100
  10. True
  11. 120
  12. 312
  13. border
  14. 134
  15. 158
  16. 242
  17. 180
  18. margin
  19. the gap to other boxes
  20. 174
  21. 154
  22. 64
  23. border
  24. False
  25. a solid or dotted edge
  26. the text or picture
  27. 78
  28. False
  29. content
  30. the line round the box
  31. 150
  32. 240
  33. space outside the border
  34. True
  35. False
  36. 150
  37. 150
  38. 194
  39. False
  40. 220

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