← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 124
  2. 216
  3. True
  4. 140
  5. content
  6. 116
  7. 116
  8. 262
  9. padding
  10. False
  11. 206
  12. 250
  13. 212
  14. border
  15. a solid or dotted edge
  16. 168
  17. 222
  18. False
  19. 302
  20. False
  21. margin
  22. 228
  23. 314
  24. False
  25. 316
  26. 224
  27. 216
  28. border
  29. 200
  30. 300
  31. the text or picture
  32. space outside the border
  33. the line round the box
  34. 134
  35. 182
  36. 98
  37. False
  38. False
  39. 188
  40. 224

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