← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 326
  3. 240
  4. 184
  5. space inside the border
  6. 226
  7. 182
  8. 226
  9. 358
  10. 304
  11. 276
  12. 208
  13. 192
  14. 132
  15. the text or picture
  16. 196
  17. 302
  18. border
  19. 304
  20. the gap to other boxes
  21. True
  22. True
  23. False
  24. margin
  25. 290
  26. padding
  27. 354
  28. a solid or dotted edge
  29. 122
  30. 170
  31. False
  32. margin
  33. 324
  34. 130
  35. False
  36. 198
  37. the gap round content
  38. 324
  39. 318
  40. 244

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