← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 198
  2. False
  3. 254
  4. 194
  5. False
  6. 280
  7. True
  8. content
  9. 232
  10. space inside the border
  11. 190
  12. 368
  13. the gap to other boxes
  14. 242
  15. 310
  16. 180
  17. 104
  18. 148
  19. padding
  20. the text or picture
  21. 340
  22. False
  23. 216
  24. True
  25. border
  26. 276
  27. True
  28. 196
  29. False
  30. False
  31. 64
  32. padding
  33. 108
  34. 76
  35. 248
  36. 164
  37. the line round the box
  38. 192
  39. 192
  40. the gap round content

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