← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. the gap to other boxes
  3. 100
  4. content
  5. padding
  6. the gap round content
  7. 334
  8. 234
  9. 188
  10. 140
  11. 316
  12. 292
  13. 146
  14. False
  15. the text or picture
  16. 168
  17. 358
  18. 122
  19. margin
  20. 344
  21. padding
  22. 208
  23. 202
  24. space outside the border
  25. 116
  26. 174
  27. 250
  28. False
  29. 154
  30. False
  31. 218
  32. 112
  33. 312
  34. 164
  35. 288
  36. space inside the border
  37. 126
  38. a solid or dotted edge
  39. False
  40. True

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