← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. content
  3. 254
  4. 110
  5. the gap round content
  6. True
  7. 82
  8. space outside the border
  9. False
  10. 244
  11. False
  12. 176
  13. 264
  14. 288
  15. margin
  16. True
  17. 118
  18. 276
  19. 198
  20. 180
  21. border
  22. False
  23. 128
  24. True
  25. the gap to other boxes
  26. 70
  27. 270
  28. 252
  29. 106
  30. space inside the border
  31. 318
  32. 98
  33. 90
  34. True
  35. 178
  36. border
  37. 192
  38. 198
  39. padding
  40. False

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