← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. margin
  3. False
  4. padding
  5. the gap round content
  6. 234
  7. 242
  8. False
  9. True
  10. True
  11. 306
  12. the line round the box
  13. 168
  14. 252
  15. padding
  16. True
  17. 312
  18. 166
  19. 136
  20. border
  21. True
  22. True
  23. space outside the border
  24. False
  25. False
  26. False
  27. margin
  28. border
  29. 128
  30. 144
  31. space inside the border
  32. 152
  33. 362
  34. 164
  35. False
  36. the gap to other boxes
  37. 228
  38. 128
  39. content
  40. False

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