← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 162
  2. space outside the border
  3. 134
  4. the text or picture
  5. 198
  6. 254
  7. 298
  8. border
  9. content
  10. True
  11. 316
  12. margin
  13. padding
  14. False
  15. 296
  16. 190
  17. 124
  18. False
  19. False
  20. 142
  21. 240
  22. False
  23. padding
  24. 176
  25. True
  26. False
  27. 128
  28. 238
  29. 148
  30. 322
  31. 292
  32. 284
  33. False
  34. 330
  35. 192
  36. 120
  37. 226
  38. the gap to other boxes
  39. False
  40. False

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