← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 102
  3. the text or picture
  4. the gap round content
  5. 158
  6. space inside the border
  7. 166
  8. False
  9. True
  10. 264
  11. margin
  12. 162
  13. False
  14. 294
  15. 118
  16. True
  17. 204
  18. 238
  19. False
  20. 174
  21. 164
  22. True
  23. padding
  24. a solid or dotted edge
  25. True
  26. 124
  27. 208
  28. 258
  29. 224
  30. True
  31. 154
  32. False
  33. 336
  34. space outside the border
  35. 194
  36. 338
  37. the line round the box
  38. 224
  39. False
  40. 348

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