← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. content
  3. 110
  4. 70
  5. margin
  6. 246
  7. 234
  8. True
  9. a solid or dotted edge
  10. 216
  11. 298
  12. 248
  13. space inside the border
  14. the line round the box
  15. 250
  16. the gap round content
  17. padding
  18. 250
  19. 202
  20. 204
  21. 298
  22. border
  23. 208
  24. 288
  25. 264
  26. 196
  27. 138
  28. 240
  29. 214
  30. True
  31. margin
  32. True
  33. 194
  34. 224
  35. border
  36. 202
  37. 196
  38. False
  39. space outside the border
  40. 330

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