← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. 120
  3. False
  4. 266
  5. 302
  6. 150
  7. border
  8. 104
  9. True
  10. 326
  11. 218
  12. 122
  13. False
  14. 244
  15. True
  16. margin
  17. 122
  18. False
  19. 216
  20. True
  21. 140
  22. space outside the border
  23. 190
  24. the gap to other boxes
  25. 242
  26. the text or picture
  27. True
  28. 224
  29. False
  30. 232
  31. False
  32. False
  33. 272
  34. False
  35. 84
  36. space inside the border
  37. True
  38. 218
  39. 176
  40. 218

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