← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. a solid or dotted edge
  2. space inside the border
  3. the text or picture
  4. border
  5. False
  6. 246
  7. 142
  8. margin
  9. 208
  10. 84
  11. 212
  12. False
  13. 170
  14. the gap to other boxes
  15. True
  16. True
  17. border
  18. 228
  19. True
  20. False
  21. 174
  22. 298
  23. 158
  24. padding
  25. padding
  26. 136
  27. 360
  28. 308
  29. 108
  30. 182
  31. False
  32. 100
  33. 236
  34. 214
  35. 148
  36. the gap round content
  37. True
  38. 134
  39. 170
  40. 146

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