← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. False
  3. 122
  4. 200
  5. 282
  6. 140
  7. True
  8. 252
  9. 252
  10. the text or picture
  11. space inside the border
  12. margin
  13. 166
  14. 232
  15. 356
  16. 192
  17. 130
  18. 218
  19. the gap to other boxes
  20. 278
  21. 200
  22. 144
  23. padding
  24. 338
  25. 68
  26. 182
  27. 102
  28. False
  29. 292
  30. False
  31. 328
  32. False
  33. 174
  34. 210
  35. 190
  36. 114
  37. 148
  38. 234
  39. the line round the box
  40. False

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