← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap round content
  2. True
  3. padding
  4. a solid or dotted edge
  5. 224
  6. 290
  7. content
  8. 236
  9. 336
  10. 182
  11. margin
  12. True
  13. the text or picture
  14. 216
  15. space inside the border
  16. False
  17. border
  18. space outside the border
  19. 260
  20. 322
  21. padding
  22. False
  23. 96
  24. 86
  25. 128
  26. True
  27. the gap to other boxes
  28. True
  29. 330
  30. 238
  31. True
  32. 162
  33. 246
  34. False
  35. 186
  36. 252
  37. the line round the box
  38. 152
  39. True
  40. False

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