← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 152
  2. True
  3. True
  4. 174
  5. 262
  6. 234
  7. 260
  8. False
  9. 88
  10. space inside the border
  11. 300
  12. False
  13. 226
  14. 284
  15. 160
  16. 260
  17. 180
  18. 366
  19. 154
  20. padding
  21. 108
  22. 248
  23. 326
  24. True
  25. a solid or dotted edge
  26. content
  27. the gap to other boxes
  28. 260
  29. False
  30. 230
  31. 94
  32. space outside the border
  33. 200
  34. 72
  35. 244
  36. 104
  37. the text or picture
  38. 268
  39. margin
  40. False

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