← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. padding
  3. False
  4. margin
  5. 190
  6. True
  7. False
  8. 260
  9. the gap to other boxes
  10. 360
  11. 212
  12. space outside the border
  13. 184
  14. 224
  15. the gap round content
  16. 242
  17. 148
  18. False
  19. 356
  20. False
  21. 132
  22. space inside the border
  23. 254
  24. 250
  25. 112
  26. False
  27. 234
  28. 198
  29. the text or picture
  30. 362
  31. 300
  32. 262
  33. 324
  34. 150
  35. 114
  36. True
  37. padding
  38. 356
  39. border
  40. margin

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