← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 300
  2. content
  3. False
  4. space inside the border
  5. 270
  6. False
  7. margin
  8. True
  9. the gap round content
  10. True
  11. 134
  12. 250
  13. 300
  14. 286
  15. 188
  16. 256
  17. padding
  18. 238
  19. the text or picture
  20. False
  21. padding
  22. border
  23. 332
  24. 142
  25. 260
  26. False
  27. 124
  28. 134
  29. space outside the border
  30. 152
  31. the gap to other boxes
  32. 364
  33. 286
  34. 296
  35. 182
  36. False
  37. 212
  38. 150
  39. 146
  40. True

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