← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. 190
  3. 212
  4. space outside the border
  5. border
  6. True
  7. 230
  8. border
  9. 170
  10. True
  11. 150
  12. margin
  13. False
  14. the gap to other boxes
  15. the line round the box
  16. 298
  17. a solid or dotted edge
  18. the text or picture
  19. 262
  20. 248
  21. 238
  22. 202
  23. True
  24. True
  25. False
  26. 316
  27. 190
  28. content
  29. True
  30. 140
  31. 286
  32. False
  33. 196
  34. the gap round content
  35. False
  36. 110
  37. 104
  38. True
  39. False
  40. 346

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