← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 108
  2. border
  3. 276
  4. a solid or dotted edge
  5. margin
  6. False
  7. 124
  8. 106
  9. margin
  10. 224
  11. padding
  12. False
  13. 172
  14. 122
  15. 134
  16. space inside the border
  17. the text or picture
  18. 100
  19. content
  20. 164
  21. 144
  22. True
  23. 380
  24. False
  25. 252
  26. 252
  27. 302
  28. 238
  29. 222
  30. space outside the border
  31. True
  32. 102
  33. 274
  34. False
  35. padding
  36. the gap to other boxes
  37. the gap round content
  38. the line round the box
  39. 146
  40. 200

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