← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. False
  3. 124
  4. True
  5. the line round the box
  6. padding
  7. 272
  8. space inside the border
  9. True
  10. 234
  11. False
  12. the gap round content
  13. False
  14. 370
  15. border
  16. 266
  17. False
  18. margin
  19. padding
  20. 278
  21. False
  22. the text or picture
  23. True
  24. margin
  25. 136
  26. the gap to other boxes
  27. 190
  28. False
  29. 210
  30. 312
  31. space outside the border
  32. 230
  33. 130
  34. 354
  35. True
  36. True
  37. False
  38. 228
  39. 162
  40. 332

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