← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 208
  2. 272
  3. the gap to other boxes
  4. 130
  5. padding
  6. 104
  7. content
  8. 306
  9. 132
  10. True
  11. 164
  12. 250
  13. True
  14. 208
  15. 82
  16. space inside the border
  17. the text or picture
  18. False
  19. 250
  20. 168
  21. 258
  22. 316
  23. True
  24. 108
  25. 316
  26. the gap round content
  27. padding
  28. 182
  29. 260
  30. space outside the border
  31. False
  32. False
  33. the line round the box
  34. margin
  35. 304
  36. 262
  37. True
  38. 302
  39. 198
  40. border

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