← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. padding
  3. 104
  4. True
  5. 116
  6. 124
  7. 90
  8. False
  9. border
  10. margin
  11. 160
  12. 282
  13. the line round the box
  14. 156
  15. 280
  16. 254
  17. 224
  18. 100
  19. content
  20. 196
  21. border
  22. 84
  23. 126
  24. 232
  25. 342
  26. padding
  27. margin
  28. 268
  29. False
  30. 132
  31. True
  32. False
  33. 98
  34. 170
  35. 224
  36. space inside the border
  37. True
  38. 300
  39. 114
  40. False

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