← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 134
  3. True
  4. the text or picture
  5. padding
  6. False
  7. 194
  8. False
  9. True
  10. margin
  11. False
  12. 316
  13. 154
  14. content
  15. 292
  16. 212
  17. border
  18. space outside the border
  19. False
  20. 96
  21. True
  22. padding
  23. 106
  24. 128
  25. False
  26. 276
  27. the gap round content
  28. 156
  29. space inside the border
  30. 112
  31. 248
  32. 196
  33. 132
  34. 302
  35. the gap to other boxes
  36. 322
  37. True
  38. 154
  39. 220
  40. 172

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