← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 218
  2. 124
  3. 152
  4. 182
  5. padding
  6. border
  7. 206
  8. False
  9. False
  10. margin
  11. padding
  12. 114
  13. False
  14. 210
  15. 332
  16. 324
  17. 206
  18. space inside the border
  19. 228
  20. the gap to other boxes
  21. True
  22. 116
  23. border
  24. 232
  25. 112
  26. 160
  27. margin
  28. content
  29. 284
  30. 262
  31. 160
  32. 102
  33. space outside the border
  34. 276
  35. 330
  36. 130
  37. 214
  38. 302
  39. 232
  40. the text or picture

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