← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. True
  3. 132
  4. padding
  5. 308
  6. False
  7. 118
  8. space inside the border
  9. the gap round content
  10. the gap to other boxes
  11. the text or picture
  12. 298
  13. 132
  14. space outside the border
  15. True
  16. 236
  17. 308
  18. 176
  19. 214
  20. padding
  21. 248
  22. 176
  23. 326
  24. border
  25. border
  26. 180
  27. margin
  28. the line round the box
  29. 132
  30. 192
  31. 224
  32. 174
  33. 102
  34. a solid or dotted edge
  35. False
  36. 198
  37. 250
  38. margin
  39. 254
  40. 324

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