← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 148
  2. border
  3. True
  4. margin
  5. 74
  6. content
  7. border
  8. 116
  9. padding
  10. True
  11. 206
  12. False
  13. the text or picture
  14. space inside the border
  15. 150
  16. the line round the box
  17. 106
  18. 146
  19. 260
  20. 114
  21. 136
  22. 206
  23. True
  24. False
  25. space outside the border
  26. False
  27. 198
  28. 276
  29. 342
  30. 62
  31. 112
  32. 128
  33. padding
  34. 180
  35. 84
  36. 162
  37. 194
  38. 118
  39. 232
  40. the gap to other boxes

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