← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. the text or picture
  3. 234
  4. 272
  5. 126
  6. 134
  7. 322
  8. space inside the border
  9. padding
  10. 222
  11. 236
  12. 312
  13. the gap round content
  14. the line round the box
  15. False
  16. False
  17. 250
  18. 398
  19. margin
  20. False
  21. 232
  22. 128
  23. 76
  24. the gap to other boxes
  25. True
  26. True
  27. 124
  28. 322
  29. a solid or dotted edge
  30. 234
  31. 130
  32. False
  33. False
  34. 256
  35. 66
  36. 236
  37. 156
  38. 214
  39. padding
  40. True

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