← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 106
  2. space inside the border
  3. 110
  4. margin
  5. False
  6. 182
  7. padding
  8. 354
  9. the text or picture
  10. margin
  11. border
  12. False
  13. the gap round content
  14. a solid or dotted edge
  15. 102
  16. 240
  17. the gap to other boxes
  18. 264
  19. 302
  20. True
  21. True
  22. the line round the box
  23. 186
  24. 300
  25. 120
  26. False
  27. padding
  28. 96
  29. False
  30. 268
  31. False
  32. 182
  33. 344
  34. 354
  35. 122
  36. 212
  37. False
  38. 314
  39. 306
  40. space outside the border

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