← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 170
  2. 146
  3. True
  4. the gap round content
  5. True
  6. True
  7. 104
  8. padding
  9. 154
  10. border
  11. False
  12. 270
  13. margin
  14. content
  15. padding
  16. margin
  17. 168
  18. space inside the border
  19. 224
  20. the gap to other boxes
  21. 136
  22. 340
  23. 240
  24. 320
  25. True
  26. the text or picture
  27. 332
  28. 122
  29. a solid or dotted edge
  30. False
  31. 110
  32. 104
  33. 354
  34. False
  35. 234
  36. 142
  37. the line round the box
  38. False
  39. 308
  40. 228

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