← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 286
  2. 208
  3. the text or picture
  4. True
  5. False
  6. border
  7. 138
  8. 166
  9. 170
  10. 136
  11. False
  12. the gap to other boxes
  13. 158
  14. 242
  15. False
  16. 198
  17. 102
  18. True
  19. False
  20. True
  21. the gap round content
  22. False
  23. border
  24. 122
  25. space inside the border
  26. True
  27. 104
  28. 114
  29. a solid or dotted edge
  30. 130
  31. False
  32. False
  33. 220
  34. 306
  35. padding
  36. 250
  37. 78
  38. content
  39. 260
  40. False

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