← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap round content
  2. 194
  3. True
  4. margin
  5. margin
  6. 200
  7. the line round the box
  8. padding
  9. space outside the border
  10. content
  11. a solid or dotted edge
  12. border
  13. 124
  14. 126
  15. True
  16. True
  17. 150
  18. 180
  19. 96
  20. 226
  21. False
  22. 284
  23. 238
  24. padding
  25. the text or picture
  26. space inside the border
  27. 94
  28. 352
  29. 340
  30. 182
  31. 200
  32. 182
  33. 92
  34. 226
  35. False
  36. False
  37. True
  38. 162
  39. True
  40. 298

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