← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 306
  2. 244
  3. 158
  4. False
  5. 194
  6. 76
  7. the text or picture
  8. True
  9. 260
  10. 248
  11. False
  12. 310
  13. False
  14. space inside the border
  15. True
  16. True
  17. 118
  18. False
  19. padding
  20. space outside the border
  21. False
  22. margin
  23. 276
  24. the gap to other boxes
  25. border
  26. 132
  27. False
  28. 174
  29. a solid or dotted edge
  30. content
  31. the line round the box
  32. 132
  33. 260
  34. margin
  35. padding
  36. 120
  37. 224
  38. 144
  39. 194
  40. 264

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