← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 212
  3. the gap to other boxes
  4. the text or picture
  5. 300
  6. True
  7. content
  8. 218
  9. 126
  10. 330
  11. False
  12. 390
  13. 244
  14. 148
  15. False
  16. margin
  17. True
  18. 94
  19. 144
  20. 188
  21. False
  22. 332
  23. 352
  24. padding
  25. border
  26. space inside the border
  27. False
  28. the gap round content
  29. 110
  30. the line round the box
  31. True
  32. 132
  33. 108
  34. a solid or dotted edge
  35. 180
  36. 168
  37. False
  38. 214
  39. 118
  40. padding

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