← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 152
  2. 192
  3. the gap round content
  4. 160
  5. 90
  6. True
  7. 314
  8. 122
  9. margin
  10. border
  11. the line round the box
  12. 146
  13. 128
  14. 98
  15. False
  16. 102
  17. a solid or dotted edge
  18. 334
  19. True
  20. 174
  21. content
  22. space outside the border
  23. margin
  24. 90
  25. False
  26. 266
  27. 122
  28. 142
  29. 322
  30. the gap to other boxes
  31. 174
  32. False
  33. False
  34. padding
  35. 202
  36. 312
  37. 114
  38. space inside the border
  39. False
  40. 292

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