← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. border
  3. border
  4. 362
  5. True
  6. 102
  7. 284
  8. 98
  9. 102
  10. 254
  11. 106
  12. True
  13. space outside the border
  14. 178
  15. content
  16. 170
  17. 106
  18. 132
  19. False
  20. space inside the border
  21. 122
  22. 194
  23. 114
  24. 124
  25. padding
  26. 316
  27. 174
  28. the line round the box
  29. 190
  30. False
  31. margin
  32. 84
  33. 386
  34. 100
  35. 110
  36. 124
  37. 186
  38. the text or picture
  39. False
  40. 198

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