← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. 114
  3. margin
  4. padding
  5. False
  6. the gap to other boxes
  7. False
  8. False
  9. the gap round content
  10. 160
  11. border
  12. 336
  13. True
  14. 262
  15. border
  16. content
  17. True
  18. 322
  19. True
  20. 110
  21. 164
  22. 142
  23. margin
  24. 224
  25. a solid or dotted edge
  26. 200
  27. 82
  28. False
  29. 76
  30. space inside the border
  31. 158
  32. 134
  33. False
  34. 156
  35. False
  36. 182
  37. 186
  38. True
  39. 292
  40. 100

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