← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space outside the border
  2. padding
  3. 236
  4. 148
  5. the gap round content
  6. 222
  7. 168
  8. 250
  9. True
  10. True
  11. 252
  12. 72
  13. 230
  14. 122
  15. 158
  16. 192
  17. False
  18. 226
  19. 92
  20. the text or picture
  21. 112
  22. space inside the border
  23. False
  24. 92
  25. 154
  26. True
  27. 282
  28. False
  29. 100
  30. 116
  31. border
  32. False
  33. 126
  34. 180
  35. 202
  36. content
  37. margin
  38. False
  39. 164
  40. 220

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