← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. 182
  3. space inside the border
  4. True
  5. True
  6. True
  7. the line round the box
  8. the gap round content
  9. 134
  10. 274
  11. 330
  12. border
  13. padding
  14. 310
  15. 310
  16. a solid or dotted edge
  17. False
  18. False
  19. 100
  20. margin
  21. False
  22. 144
  23. content
  24. 90
  25. False
  26. 178
  27. False
  28. 302
  29. 198
  30. 190
  31. 342
  32. 174
  33. 130
  34. 220
  35. 312
  36. space outside the border
  37. 202
  38. 242
  39. 92
  40. 202

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