← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 202
  2. False
  3. space inside the border
  4. border
  5. False
  6. True
  7. content
  8. 272
  9. 136
  10. 288
  11. 98
  12. False
  13. the gap round content
  14. border
  15. 238
  16. margin
  17. the text or picture
  18. 136
  19. True
  20. the line round the box
  21. space outside the border
  22. 176
  23. a solid or dotted edge
  24. the gap to other boxes
  25. 132
  26. padding
  27. 172
  28. 198
  29. True
  30. 178
  31. 238
  32. 238
  33. 118
  34. 180
  35. 112
  36. 314
  37. 294
  38. 188
  39. False
  40. False

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