← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 176
  2. space inside the border
  3. False
  4. a solid or dotted edge
  5. content
  6. margin
  7. 122
  8. 120
  9. padding
  10. True
  11. 140
  12. 206
  13. 302
  14. 144
  15. 156
  16. True
  17. 214
  18. 100
  19. False
  20. 304
  21. False
  22. 214
  23. margin
  24. border
  25. 100
  26. the gap to other boxes
  27. 190
  28. 194
  29. 190
  30. 188
  31. padding
  32. 318
  33. 184
  34. 74
  35. False
  36. False
  37. the gap round content
  38. False
  39. True
  40. 302

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