← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 334
  2. False
  3. 224
  4. 244
  5. content
  6. 174
  7. True
  8. 152
  9. False
  10. 264
  11. 252
  12. space inside the border
  13. 158
  14. border
  15. 178
  16. False
  17. 332
  18. False
  19. 114
  20. False
  21. 282
  22. 366
  23. margin
  24. False
  25. 104
  26. 106
  27. the gap to other boxes
  28. the gap round content
  29. 86
  30. False
  31. 166
  32. 152
  33. the text or picture
  34. 352
  35. 242
  36. 282
  37. 140
  38. 214
  39. padding
  40. 354

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