← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. the text or picture
  3. False
  4. border
  5. 346
  6. 226
  7. 106
  8. the line round the box
  9. False
  10. padding
  11. 82
  12. the gap round content
  13. 272
  14. True
  15. margin
  16. 214
  17. True
  18. 332
  19. False
  20. False
  21. 114
  22. 216
  23. True
  24. padding
  25. 308
  26. 106
  27. 140
  28. 108
  29. 264
  30. 102
  31. 148
  32. 256
  33. the gap to other boxes
  34. 206
  35. 340
  36. 210
  37. 274
  38. 250
  39. 150
  40. 310

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