← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. 142
  3. content
  4. False
  5. False
  6. border
  7. 192
  8. 240
  9. 222
  10. True
  11. 232
  12. space outside the border
  13. True
  14. the gap round content
  15. padding
  16. False
  17. the gap to other boxes
  18. 334
  19. 96
  20. 230
  21. 308
  22. 184
  23. 108
  24. False
  25. a solid or dotted edge
  26. 206
  27. 130
  28. margin
  29. False
  30. margin
  31. 198
  32. 134
  33. 146
  34. 194
  35. the line round the box
  36. False
  37. 234
  38. 98
  39. 186
  40. False

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