← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. False
  3. 164
  4. the text or picture
  5. a solid or dotted edge
  6. True
  7. 176
  8. padding
  9. space outside the border
  10. False
  11. 194
  12. the line round the box
  13. True
  14. margin
  15. True
  16. 116
  17. the gap round content
  18. 114
  19. True
  20. 230
  21. padding
  22. content
  23. 264
  24. 100
  25. 242
  26. 240
  27. 202
  28. True
  29. 122
  30. space inside the border
  31. False
  32. 108
  33. 186
  34. 122
  35. 122
  36. 138
  37. False
  38. the gap to other boxes
  39. 330
  40. 166

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