← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. space outside the border
  3. 250
  4. 198
  5. border
  6. border
  7. content
  8. True
  9. margin
  10. 240
  11. padding
  12. 174
  13. padding
  14. True
  15. 208
  16. 226
  17. 212
  18. 190
  19. 232
  20. 94
  21. 274
  22. 204
  23. 182
  24. 284
  25. False
  26. 124
  27. 90
  28. 182
  29. 314
  30. 122
  31. 220
  32. the line round the box
  33. margin
  34. 290
  35. 118
  36. 310
  37. 240
  38. False
  39. 134
  40. 112

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