← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 300
  3. False
  4. 266
  5. the text or picture
  6. 334
  7. 142
  8. border
  9. border
  10. 204
  11. 212
  12. True
  13. 224
  14. 124
  15. margin
  16. 276
  17. 220
  18. 262
  19. 280
  20. 328
  21. 226
  22. 88
  23. 330
  24. 218
  25. 264
  26. 168
  27. True
  28. the gap to other boxes
  29. 88
  30. 312
  31. space inside the border
  32. 232
  33. padding
  34. 228
  35. 322
  36. 240
  37. False
  38. a solid or dotted edge
  39. 164
  40. 224

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