← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. padding
  3. 364
  4. False
  5. 300
  6. False
  7. 174
  8. border
  9. padding
  10. True
  11. a solid or dotted edge
  12. True
  13. space outside the border
  14. the gap round content
  15. 146
  16. True
  17. 230
  18. True
  19. margin
  20. the text or picture
  21. True
  22. content
  23. 232
  24. margin
  25. 270
  26. 386
  27. border
  28. 214
  29. False
  30. 286
  31. 220
  32. 214
  33. space inside the border
  34. 122
  35. 202
  36. 296
  37. 114
  38. 240
  39. 98
  40. 244

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