← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. the text or picture
  3. the gap round content
  4. 224
  5. False
  6. border
  7. 202
  8. padding
  9. space inside the border
  10. 304
  11. 362
  12. True
  13. True
  14. 128
  15. content
  16. False
  17. False
  18. 72
  19. 342
  20. 324
  21. margin
  22. padding
  23. True
  24. 100
  25. 238
  26. 292
  27. 376
  28. 132
  29. 270
  30. the gap to other boxes
  31. False
  32. 316
  33. 220
  34. 170
  35. False
  36. 170
  37. 240
  38. False
  39. 342
  40. 332

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