← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 114
  2. the text or picture
  3. False
  4. 308
  5. 66
  6. True
  7. the line round the box
  8. 150
  9. 150
  10. the gap round content
  11. 188
  12. padding
  13. False
  14. 258
  15. 196
  16. 176
  17. 178
  18. 164
  19. border
  20. 308
  21. space inside the border
  22. a solid or dotted edge
  23. 212
  24. 272
  25. 244
  26. 310
  27. False
  28. margin
  29. 132
  30. 298
  31. 114
  32. 132
  33. the gap to other boxes
  34. 82
  35. False
  36. 186
  37. padding
  38. 122
  39. True
  40. content

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