← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 114
  2. True
  3. border
  4. 224
  5. False
  6. 132
  7. 254
  8. padding
  9. the text or picture
  10. False
  11. 262
  12. content
  13. space inside the border
  14. 318
  15. padding
  16. 242
  17. 144
  18. 200
  19. 148
  20. True
  21. False
  22. 228
  23. border
  24. 258
  25. margin
  26. True
  27. 200
  28. 246
  29. 154
  30. 224
  31. 248
  32. 148
  33. 230
  34. the line round the box
  35. False
  36. False
  37. False
  38. 254
  39. margin
  40. 220

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