← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. False
  3. the text or picture
  4. 212
  5. space inside the border
  6. 126
  7. 110
  8. the gap to other boxes
  9. True
  10. 142
  11. 102
  12. margin
  13. 274
  14. 192
  15. margin
  16. 302
  17. True
  18. 112
  19. space outside the border
  20. 326
  21. 146
  22. 212
  23. 124
  24. False
  25. padding
  26. 250
  27. 202
  28. border
  29. padding
  30. 276
  31. 306
  32. 220
  33. False
  34. 270
  35. 264
  36. the gap round content
  37. 112
  38. 100
  39. 86
  40. 252

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