← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. False
  3. 184
  4. 158
  5. 272
  6. 326
  7. padding
  8. padding
  9. content
  10. 310
  11. 92
  12. 304
  13. True
  14. border
  15. 144
  16. the text or picture
  17. 200
  18. False
  19. 152
  20. 228
  21. 128
  22. margin
  23. 274
  24. 188
  25. 248
  26. 120
  27. border
  28. 242
  29. 276
  30. 72
  31. 62
  32. 280
  33. False
  34. 234
  35. 238
  36. 70
  37. space outside the border
  38. the gap round content
  39. space inside the border
  40. 258

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