← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 324
  2. True
  3. 212
  4. space inside the border
  5. space outside the border
  6. False
  7. padding
  8. 178
  9. 250
  10. 312
  11. True
  12. 130
  13. the text or picture
  14. margin
  15. the line round the box
  16. True
  17. padding
  18. 260
  19. 162
  20. margin
  21. 112
  22. 120
  23. 382
  24. the gap to other boxes
  25. True
  26. 218
  27. 122
  28. False
  29. 82
  30. 272
  31. True
  32. False
  33. 222
  34. content
  35. 140
  36. 236
  37. 302
  38. 120
  39. 274
  40. 206

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