← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 204
  2. False
  3. 152
  4. False
  5. space outside the border
  6. margin
  7. 332
  8. 342
  9. 244
  10. 240
  11. 204
  12. the gap to other boxes
  13. True
  14. 262
  15. border
  16. padding
  17. 380
  18. 144
  19. content
  20. 116
  21. the text or picture
  22. 224
  23. 288
  24. 134
  25. margin
  26. 66
  27. 326
  28. 192
  29. border
  30. 330
  31. 228
  32. 120
  33. 298
  34. the gap round content
  35. 152
  36. 172
  37. padding
  38. 130
  39. 176
  40. 194

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