← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 154
  2. True
  3. True
  4. 228
  5. 130
  6. 214
  7. 150
  8. 136
  9. 300
  10. True
  11. 176
  12. 278
  13. margin
  14. False
  15. False
  16. 222
  17. 268
  18. True
  19. 90
  20. space inside the border
  21. 118
  22. 132
  23. 224
  24. 238
  25. 138
  26. True
  27. padding
  28. 180
  29. 268
  30. 180
  31. False
  32. the text or picture
  33. 144
  34. 92
  35. content
  36. padding
  37. 154
  38. 90
  39. 116
  40. 154

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