← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space outside the border
  2. space inside the border
  3. content
  4. 262
  5. the text or picture
  6. 288
  7. 130
  8. False
  9. False
  10. border
  11. True
  12. 130
  13. False
  14. 348
  15. 114
  16. 162
  17. 194
  18. 140
  19. 234
  20. 176
  21. False
  22. 256
  23. margin
  24. margin
  25. False
  26. padding
  27. True
  28. 330
  29. 102
  30. the gap to other boxes
  31. 220
  32. 114
  33. 164
  34. 118
  35. 114
  36. 212
  37. 116
  38. True
  39. 258
  40. True

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