← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 76
  3. 316
  4. the line round the box
  5. 206
  6. 140
  7. 142
  8. True
  9. padding
  10. margin
  11. 252
  12. 214
  13. space outside the border
  14. 320
  15. 178
  16. False
  17. the text or picture
  18. 108
  19. border
  20. 106
  21. 344
  22. 228
  23. False
  24. 106
  25. 224
  26. a solid or dotted edge
  27. 390
  28. True
  29. 320
  30. 306
  31. 214
  32. 324
  33. 300
  34. border
  35. 154
  36. 330
  37. 308
  38. 216
  39. 348
  40. 152

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