← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 200
  2. True
  3. 162
  4. the text or picture
  5. 224
  6. 288
  7. 286
  8. border
  9. False
  10. 154
  11. False
  12. the line round the box
  13. 172
  14. 122
  15. True
  16. 230
  17. content
  18. 154
  19. 316
  20. True
  21. padding
  22. False
  23. 338
  24. 370
  25. margin
  26. 214
  27. the gap round content
  28. 222
  29. 310
  30. True
  31. space inside the border
  32. 134
  33. 294
  34. 88
  35. 226
  36. border
  37. margin
  38. 262
  39. 226
  40. 358

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