← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 188
  2. 166
  3. space inside the border
  4. border
  5. 328
  6. a solid or dotted edge
  7. 200
  8. padding
  9. 78
  10. the gap round content
  11. 112
  12. 208
  13. 170
  14. border
  15. False
  16. 114
  17. padding
  18. False
  19. 134
  20. the text or picture
  21. True
  22. margin
  23. 242
  24. 254
  25. 90
  26. 308
  27. 196
  28. 178
  29. 286
  30. 150
  31. 224
  32. 62
  33. 180
  34. 334
  35. 132
  36. 268
  37. content
  38. 196
  39. False
  40. 320

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