← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. 62
  3. 226
  4. a solid or dotted edge
  5. 202
  6. 240
  7. space outside the border
  8. True
  9. 152
  10. 222
  11. 322
  12. 236
  13. 198
  14. 166
  15. 154
  16. padding
  17. the gap round content
  18. 172
  19. space inside the border
  20. the text or picture
  21. border
  22. 264
  23. the line round the box
  24. 152
  25. 232
  26. 140
  27. False
  28. False
  29. 150
  30. 62
  31. border
  32. 330
  33. 106
  34. True
  35. False
  36. 122
  37. 154
  38. False
  39. False
  40. 366

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