← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. True
  3. True
  4. 314
  5. border
  6. space inside the border
  7. True
  8. 224
  9. 166
  10. margin
  11. border
  12. 114
  13. False
  14. 134
  15. 80
  16. space outside the border
  17. 246
  18. 160
  19. True
  20. padding
  21. margin
  22. 200
  23. the text or picture
  24. 130
  25. 140
  26. 212
  27. False
  28. False
  29. 178
  30. 180
  31. 230
  32. padding
  33. 210
  34. 180
  35. 112
  36. 298
  37. 256
  38. content
  39. False
  40. 310

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