← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. 364
  3. 304
  4. 150
  5. content
  6. 150
  7. padding
  8. False
  9. 272
  10. 132
  11. 124
  12. 104
  13. 266
  14. 150
  15. padding
  16. 130
  17. 262
  18. border
  19. the gap to other boxes
  20. 142
  21. 326
  22. 150
  23. 138
  24. 108
  25. False
  26. True
  27. the text or picture
  28. margin
  29. False
  30. True
  31. 126
  32. 206
  33. space outside the border
  34. 130
  35. 176
  36. False
  37. True
  38. 160
  39. margin
  40. True

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