← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 230
  3. False
  4. False
  5. 172
  6. 170
  7. the line round the box
  8. 128
  9. margin
  10. 366
  11. space outside the border
  12. border
  13. 250
  14. True
  15. 170
  16. 320
  17. 98
  18. 162
  19. True
  20. space inside the border
  21. 132
  22. 328
  23. 122
  24. 82
  25. padding
  26. 198
  27. the gap to other boxes
  28. False
  29. 186
  30. True
  31. 134
  32. 320
  33. border
  34. False
  35. 188
  36. True
  37. False
  38. False
  39. 124
  40. content

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