← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 326
  2. 238
  3. margin
  4. padding
  5. 356
  6. 146
  7. True
  8. the text or picture
  9. False
  10. the line round the box
  11. border
  12. True
  13. 344
  14. 160
  15. 112
  16. 96
  17. False
  18. 210
  19. 158
  20. space outside the border
  21. False
  22. margin
  23. 350
  24. True
  25. 94
  26. content
  27. 114
  28. 122
  29. False
  30. 218
  31. 206
  32. 274
  33. 242
  34. 242
  35. 302
  36. 156
  37. False
  38. border
  39. True
  40. True

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