← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. space outside the border
  3. False
  4. padding
  5. 200
  6. padding
  7. False
  8. 114
  9. 184
  10. 206
  11. 238
  12. the gap to other boxes
  13. margin
  14. True
  15. 344
  16. 246
  17. False
  18. 164
  19. 152
  20. content
  21. border
  22. 206
  23. 346
  24. 200
  25. 266
  26. 350
  27. 98
  28. margin
  29. True
  30. the gap round content
  31. 272
  32. 222
  33. True
  34. 116
  35. 114
  36. the text or picture
  37. 118
  38. 126
  39. True
  40. True

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