← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. True
  3. False
  4. 108
  5. 188
  6. border
  7. 184
  8. 192
  9. 120
  10. True
  11. margin
  12. the text or picture
  13. 80
  14. 222
  15. False
  16. padding
  17. 168
  18. border
  19. 96
  20. 316
  21. 100
  22. 166
  23. content
  24. 170
  25. the gap to other boxes
  26. False
  27. 354
  28. a solid or dotted edge
  29. 226
  30. 202
  31. space inside the border
  32. 238
  33. 270
  34. 250
  35. True
  36. the gap round content
  37. margin
  38. space outside the border
  39. True
  40. 220

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