← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. 340
  3. True
  4. 280
  5. the text or picture
  6. False
  7. 178
  8. 240
  9. 152
  10. False
  11. a solid or dotted edge
  12. True
  13. 358
  14. True
  15. 264
  16. content
  17. border
  18. 282
  19. 246
  20. 286
  21. 264
  22. 82
  23. 216
  24. 102
  25. 138
  26. margin
  27. padding
  28. False
  29. space outside the border
  30. the gap round content
  31. 116
  32. False
  33. True
  34. border
  35. 144
  36. False
  37. 132
  38. 350
  39. 298
  40. 330

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