← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. space outside the border
  3. 124
  4. 266
  5. 230
  6. True
  7. 224
  8. border
  9. the text or picture
  10. space inside the border
  11. 82
  12. margin
  13. margin
  14. padding
  15. a solid or dotted edge
  16. 158
  17. 332
  18. False
  19. True
  20. padding
  21. 118
  22. 278
  23. 152
  24. 172
  25. 340
  26. border
  27. 64
  28. the gap round content
  29. 166
  30. 288
  31. 266
  32. False
  33. 154
  34. 328
  35. 306
  36. False
  37. 258
  38. 100
  39. 172
  40. True

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