← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap round content
  2. padding
  3. True
  4. content
  5. the text or picture
  6. True
  7. 190
  8. 212
  9. 132
  10. False
  11. 276
  12. 344
  13. 86
  14. 182
  15. 316
  16. 284
  17. 316
  18. True
  19. 198
  20. 302
  21. 120
  22. 124
  23. True
  24. 232
  25. True
  26. margin
  27. 162
  28. 164
  29. 242
  30. 172
  31. space inside the border
  32. border
  33. 194
  34. padding
  35. 174
  36. the gap to other boxes
  37. margin
  38. 256
  39. 150
  40. 230

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