← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 138
  2. True
  3. 282
  4. 90
  5. 144
  6. 116
  7. space outside the border
  8. 292
  9. content
  10. 192
  11. 218
  12. 158
  13. 122
  14. padding
  15. margin
  16. 222
  17. 352
  18. 314
  19. 206
  20. 66
  21. border
  22. 216
  23. False
  24. True
  25. 182
  26. 332
  27. space inside the border
  28. 232
  29. 278
  30. the gap round content
  31. 254
  32. 152
  33. the text or picture
  34. 100
  35. 222
  36. False
  37. 290
  38. 234
  39. the line round the box
  40. 166

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