← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 158
  2. the line round the box
  3. the text or picture
  4. False
  5. border
  6. 80
  7. border
  8. 262
  9. True
  10. 296
  11. False
  12. False
  13. 110
  14. 274
  15. True
  16. margin
  17. 190
  18. the gap to other boxes
  19. 182
  20. space inside the border
  21. 150
  22. True
  23. margin
  24. 232
  25. 134
  26. 132
  27. content
  28. 268
  29. 224
  30. 268
  31. a solid or dotted edge
  32. False
  33. padding
  34. False
  35. 144
  36. 294
  37. 122
  38. 202
  39. False
  40. 198

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