← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. space outside the border
  3. 214
  4. 152
  5. True
  6. 130
  7. padding
  8. content
  9. 142
  10. 338
  11. 194
  12. False
  13. 218
  14. border
  15. 228
  16. margin
  17. 136
  18. 204
  19. 252
  20. the text or picture
  21. True
  22. 304
  23. 350
  24. False
  25. 170
  26. 192
  27. 144
  28. margin
  29. 228
  30. the gap round content
  31. 102
  32. a solid or dotted edge
  33. 334
  34. False
  35. False
  36. 136
  37. 190
  38. 142
  39. False
  40. 224

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