← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap round content
  2. 328
  3. 268
  4. False
  5. 100
  6. 66
  7. 206
  8. True
  9. 122
  10. 210
  11. the line round the box
  12. 236
  13. 184
  14. the text or picture
  15. 172
  16. padding
  17. 92
  18. 346
  19. 276
  20. False
  21. margin
  22. 144
  23. 184
  24. False
  25. 182
  26. space outside the border
  27. 84
  28. 140
  29. border
  30. the gap to other boxes
  31. True
  32. 94
  33. 110
  34. 190
  35. 62
  36. 224
  37. 292
  38. 78
  39. 178
  40. False

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