← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 62
  2. padding
  3. 128
  4. content
  5. True
  6. the text or picture
  7. margin
  8. space inside the border
  9. the gap to other boxes
  10. 214
  11. 294
  12. padding
  13. False
  14. 278
  15. 282
  16. 320
  17. 174
  18. 264
  19. 304
  20. 292
  21. 302
  22. 230
  23. 276
  24. 314
  25. True
  26. border
  27. 324
  28. 306
  29. 298
  30. False
  31. margin
  32. space outside the border
  33. border
  34. True
  35. 220
  36. 118
  37. 190
  38. 266
  39. the gap round content
  40. 192

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