← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 228
  2. space inside the border
  3. 346
  4. padding
  5. the text or picture
  6. 366
  7. 170
  8. 118
  9. border
  10. 126
  11. False
  12. 208
  13. 156
  14. 246
  15. margin
  16. 142
  17. padding
  18. True
  19. 250
  20. 144
  21. 118
  22. 168
  23. 308
  24. 196
  25. 230
  26. 226
  27. the gap round content
  28. 354
  29. 218
  30. 192
  31. 118
  32. 350
  33. False
  34. False
  35. 92
  36. 194
  37. the line round the box
  38. False
  39. a solid or dotted edge
  40. False

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