← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 262
  2. 174
  3. 76
  4. False
  5. 226
  6. False
  7. the line round the box
  8. margin
  9. padding
  10. 168
  11. 188
  12. False
  13. 272
  14. True
  15. 240
  16. border
  17. 208
  18. 76
  19. True
  20. border
  21. 168
  22. 270
  23. 126
  24. 230
  25. 108
  26. 202
  27. a solid or dotted edge
  28. False
  29. 214
  30. 92
  31. True
  32. margin
  33. 166
  34. 242
  35. False
  36. 196
  37. 156
  38. 346
  39. 196
  40. padding

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