← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 132
  2. the line round the box
  3. padding
  4. 248
  5. True
  6. space outside the border
  7. 96
  8. the gap to other boxes
  9. True
  10. margin
  11. 78
  12. 292
  13. space inside the border
  14. margin
  15. 208
  16. 82
  17. 104
  18. the text or picture
  19. False
  20. 238
  21. 206
  22. content
  23. 180
  24. 216
  25. True
  26. a solid or dotted edge
  27. 96
  28. padding
  29. 74
  30. 102
  31. 298
  32. True
  33. 234
  34. 272
  35. border
  36. border
  37. 312
  38. False
  39. 214
  40. 130

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