← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 144
  2. 122
  3. margin
  4. 246
  5. False
  6. 316
  7. padding
  8. 236
  9. the gap to other boxes
  10. 190
  11. False
  12. 276
  13. 280
  14. margin
  15. False
  16. False
  17. border
  18. 248
  19. 290
  20. 282
  21. space inside the border
  22. space outside the border
  23. 122
  24. content
  25. False
  26. False
  27. True
  28. False
  29. 376
  30. 174
  31. True
  32. 172
  33. 146
  34. 172
  35. 252
  36. the text or picture
  37. the line round the box
  38. a solid or dotted edge
  39. 216
  40. 210

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