← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 308
  3. the text or picture
  4. padding
  5. False
  6. 192
  7. 138
  8. padding
  9. 170
  10. 264
  11. border
  12. border
  13. 108
  14. 120
  15. content
  16. False
  17. False
  18. margin
  19. 184
  20. 222
  21. space outside the border
  22. False
  23. 162
  24. the line round the box
  25. space inside the border
  26. a solid or dotted edge
  27. 306
  28. False
  29. False
  30. 240
  31. 286
  32. 244
  33. 158
  34. 370
  35. 370
  36. 190
  37. 252
  38. 102
  39. 252
  40. 188

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