← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 182
  2. content
  3. padding
  4. 198
  5. False
  6. False
  7. padding
  8. margin
  9. True
  10. 268
  11. 124
  12. border
  13. 214
  14. 320
  15. 122
  16. 122
  17. 214
  18. 182
  19. 224
  20. 166
  21. 134
  22. the gap round content
  23. the text or picture
  24. False
  25. space inside the border
  26. space outside the border
  27. 152
  28. margin
  29. 90
  30. 318
  31. False
  32. 330
  33. False
  34. 78
  35. 176
  36. 182
  37. 310
  38. the line round the box
  39. True
  40. True

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