← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 254
  3. 146
  4. True
  5. 248
  6. space inside the border
  7. content
  8. border
  9. margin
  10. 144
  11. a solid or dotted edge
  12. 246
  13. 86
  14. 94
  15. the line round the box
  16. True
  17. 242
  18. 252
  19. border
  20. 168
  21. 172
  22. the gap to other boxes
  23. 166
  24. True
  25. False
  26. 184
  27. the text or picture
  28. False
  29. padding
  30. 132
  31. 244
  32. True
  33. False
  34. 224
  35. 166
  36. 286
  37. True
  38. 150
  39. True
  40. 244

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