← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 284
  3. 202
  4. 242
  5. 80
  6. 312
  7. a solid or dotted edge
  8. 112
  9. 66
  10. 308
  11. 264
  12. True
  13. False
  14. 184
  15. 318
  16. padding
  17. 326
  18. space inside the border
  19. 180
  20. 158
  21. space outside the border
  22. False
  23. padding
  24. False
  25. False
  26. 216
  27. False
  28. the line round the box
  29. 276
  30. True
  31. margin
  32. False
  33. 310
  34. 242
  35. 170
  36. 320
  37. border
  38. True
  39. True
  40. the text or picture

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