← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. the gap to other boxes
  3. space inside the border
  4. the text or picture
  5. margin
  6. 114
  7. 72
  8. 354
  9. margin
  10. 74
  11. 102
  12. 114
  13. False
  14. 214
  15. True
  16. space outside the border
  17. 112
  18. 118
  19. True
  20. 204
  21. 244
  22. border
  23. 352
  24. 236
  25. border
  26. 232
  27. False
  28. the line round the box
  29. 228
  30. 100
  31. 276
  32. 200
  33. False
  34. 182
  35. 190
  36. False
  37. a solid or dotted edge
  38. 224
  39. True
  40. 218

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