← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. False
  3. 86
  4. 146
  5. 240
  6. padding
  7. 140
  8. 162
  9. 146
  10. 258
  11. 174
  12. space outside the border
  13. 150
  14. the gap round content
  15. 252
  16. 172
  17. 100
  18. margin
  19. False
  20. False
  21. 266
  22. False
  23. content
  24. 158
  25. True
  26. 138
  27. 194
  28. 162
  29. the line round the box
  30. 236
  31. 128
  32. 210
  33. the text or picture
  34. 168
  35. True
  36. 198
  37. 200
  38. padding
  39. a solid or dotted edge
  40. 180

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