← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 202
  2. 180
  3. 160
  4. the line round the box
  5. 128
  6. 114
  7. margin
  8. 132
  9. 180
  10. padding
  11. True
  12. border
  13. 108
  14. True
  15. True
  16. a solid or dotted edge
  17. 90
  18. 122
  19. False
  20. 142
  21. 244
  22. False
  23. space outside the border
  24. margin
  25. 92
  26. True
  27. False
  28. True
  29. the gap to other boxes
  30. border
  31. False
  32. 194
  33. True
  34. 108
  35. space inside the border
  36. 288
  37. False
  38. False
  39. False
  40. False

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