← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. a solid or dotted edge
  2. 90
  3. margin
  4. 204
  5. 112
  6. 302
  7. 198
  8. 216
  9. margin
  10. 206
  11. 314
  12. 224
  13. the text or picture
  14. the line round the box
  15. 162
  16. space outside the border
  17. 226
  18. 184
  19. 216
  20. padding
  21. True
  22. the gap round content
  23. padding
  24. border
  25. 148
  26. 334
  27. 158
  28. 118
  29. 230
  30. True
  31. 324
  32. 144
  33. 116
  34. True
  35. 78
  36. False
  37. 80
  38. 292
  39. 390
  40. False

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