← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 140
  2. margin
  3. True
  4. 230
  5. False
  6. border
  7. padding
  8. a solid or dotted edge
  9. 78
  10. False
  11. 120
  12. 182
  13. the gap round content
  14. 170
  15. border
  16. 380
  17. padding
  18. 242
  19. space outside the border
  20. 120
  21. content
  22. 166
  23. False
  24. 196
  25. the text or picture
  26. the line round the box
  27. True
  28. 222
  29. False
  30. False
  31. 264
  32. space inside the border
  33. 106
  34. 186
  35. False
  36. True
  37. True
  38. False
  39. 200
  40. 130

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