← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 232
  3. False
  4. 116
  5. True
  6. 148
  7. 218
  8. False
  9. padding
  10. 236
  11. False
  12. border
  13. the text or picture
  14. False
  15. 118
  16. True
  17. 192
  18. 250
  19. 236
  20. 320
  21. 234
  22. 146
  23. padding
  24. False
  25. 212
  26. 300
  27. the gap to other boxes
  28. 214
  29. 90
  30. 296
  31. False
  32. 330
  33. 350
  34. False
  35. 240
  36. 208
  37. 298
  38. space outside the border
  39. 232
  40. 172

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