← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. border
  3. False
  4. 278
  5. False
  6. 246
  7. padding
  8. 142
  9. padding
  10. 290
  11. 142
  12. True
  13. 326
  14. content
  15. 250
  16. 104
  17. 222
  18. 354
  19. the gap to other boxes
  20. 314
  21. 238
  22. 186
  23. 142
  24. the gap round content
  25. True
  26. 362
  27. 114
  28. 112
  29. False
  30. False
  31. 102
  32. space outside the border
  33. 214
  34. True
  35. 144
  36. 174
  37. 336
  38. 234
  39. 244
  40. False

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