← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 330
  2. False
  3. 250
  4. space inside the border
  5. 214
  6. 228
  7. True
  8. False
  9. padding
  10. 238
  11. 296
  12. True
  13. True
  14. False
  15. 230
  16. the gap to other boxes
  17. 62
  18. 126
  19. True
  20. False
  21. 106
  22. 168
  23. False
  24. a solid or dotted edge
  25. 216
  26. 184
  27. 256
  28. 394
  29. False
  30. 124
  31. True
  32. 264
  33. 234
  34. 142
  35. border
  36. False
  37. content
  38. 116
  39. the gap round content
  40. margin

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