← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap to other boxes
  2. margin
  3. 250
  4. space inside the border
  5. border
  6. 124
  7. 224
  8. the line round the box
  9. False
  10. 264
  11. True
  12. 262
  13. 258
  14. False
  15. 142
  16. a solid or dotted edge
  17. margin
  18. False
  19. 60
  20. 240
  21. 108
  22. True
  23. 234
  24. False
  25. 170
  26. the gap round content
  27. 276
  28. True
  29. 198
  30. True
  31. 128
  32. 118
  33. False
  34. 118
  35. 326
  36. 198
  37. 230
  38. 304
  39. 326
  40. border

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