← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 210
  2. padding
  3. 112
  4. padding
  5. False
  6. space inside the border
  7. 162
  8. border
  9. 208
  10. 298
  11. the line round the box
  12. 172
  13. False
  14. the gap round content
  15. 64
  16. 216
  17. 288
  18. the text or picture
  19. margin
  20. True
  21. False
  22. border
  23. 106
  24. True
  25. content
  26. 152
  27. False
  28. 302
  29. True
  30. False
  31. 156
  32. 240
  33. 154
  34. 112
  35. the gap to other boxes
  36. 152
  37. 168
  38. True
  39. 120
  40. 174

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