← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. True
  3. 146
  4. 136
  5. space outside the border
  6. 176
  7. 328
  8. 84
  9. 172
  10. margin
  11. 238
  12. 180
  13. True
  14. border
  15. 316
  16. border
  17. a solid or dotted edge
  18. True
  19. the gap round content
  20. the gap to other boxes
  21. 298
  22. 320
  23. margin
  24. 94
  25. False
  26. 120
  27. True
  28. 222
  29. 194
  30. False
  31. 288
  32. 264
  33. True
  34. 272
  35. 94
  36. the line round the box
  37. 146
  38. 158
  39. padding
  40. 368

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