← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 212
  2. 270
  3. padding
  4. 96
  5. False
  6. 94
  7. 350
  8. 104
  9. False
  10. margin
  11. 106
  12. 246
  13. the line round the box
  14. 224
  15. a solid or dotted edge
  16. True
  17. 154
  18. True
  19. False
  20. content
  21. 74
  22. 118
  23. space outside the border
  24. 274
  25. 200
  26. 170
  27. 172
  28. False
  29. space inside the border
  30. False
  31. 134
  32. 274
  33. 146
  34. the gap round content
  35. border
  36. False
  37. True
  38. False
  39. 166
  40. False

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