← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. 180
  3. space outside the border
  4. 238
  5. 264
  6. 140
  7. 260
  8. 128
  9. 298
  10. 130
  11. 272
  12. the gap to other boxes
  13. False
  14. margin
  15. padding
  16. padding
  17. 210
  18. margin
  19. 280
  20. the gap round content
  21. the text or picture
  22. content
  23. space inside the border
  24. False
  25. 160
  26. False
  27. 92
  28. 104
  29. False
  30. 214
  31. border
  32. 240
  33. True
  34. 112
  35. 300
  36. 132
  37. 116
  38. 146
  39. 242
  40. 136

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