← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 262
  2. False
  3. 290
  4. 168
  5. border
  6. 246
  7. 204
  8. padding
  9. False
  10. space outside the border
  11. the line round the box
  12. 208
  13. 230
  14. 166
  15. 166
  16. space inside the border
  17. 114
  18. margin
  19. a solid or dotted edge
  20. 294
  21. True
  22. 170
  23. 132
  24. 196
  25. 362
  26. border
  27. 124
  28. 316
  29. 294
  30. 172
  31. True
  32. 110
  33. 216
  34. 196
  35. 300
  36. 250
  37. margin
  38. content
  39. True
  40. the gap round content

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