← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. the gap round content
  3. 228
  4. True
  5. 140
  6. False
  7. 124
  8. the line round the box
  9. space outside the border
  10. 220
  11. 254
  12. 226
  13. 334
  14. True
  15. True
  16. margin
  17. False
  18. content
  19. 332
  20. 98
  21. False
  22. a solid or dotted edge
  23. the text or picture
  24. padding
  25. border
  26. border
  27. True
  28. 98
  29. 156
  30. 142
  31. 244
  32. 300
  33. 248
  34. False
  35. 88
  36. 138
  37. padding
  38. 234
  39. 124
  40. 246

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