← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 232
  2. border
  3. 274
  4. 354
  5. padding
  6. the gap round content
  7. False
  8. True
  9. False
  10. 106
  11. the gap to other boxes
  12. space inside the border
  13. 274
  14. border
  15. 236
  16. 196
  17. True
  18. 174
  19. False
  20. 204
  21. margin
  22. False
  23. 244
  24. 324
  25. 114
  26. 128
  27. margin
  28. the text or picture
  29. 282
  30. False
  31. 178
  32. 118
  33. 278
  34. padding
  35. 380
  36. the line round the box
  37. 122
  38. False
  39. 122
  40. 90

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