← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 168
  2. 192
  3. 234
  4. 146
  5. 216
  6. the line round the box
  7. 136
  8. 164
  9. 112
  10. 312
  11. True
  12. 316
  13. padding
  14. 82
  15. border
  16. border
  17. 114
  18. True
  19. 174
  20. 278
  21. True
  22. content
  23. space outside the border
  24. 264
  25. 294
  26. False
  27. the gap round content
  28. 266
  29. the gap to other boxes
  30. 66
  31. True
  32. 238
  33. False
  34. 110
  35. 324
  36. padding
  37. margin
  38. margin
  39. True
  40. 328

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