← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 128
  2. margin
  3. 302
  4. 190
  5. the text or picture
  6. True
  7. the gap to other boxes
  8. 176
  9. 242
  10. 218
  11. True
  12. 328
  13. 120
  14. border
  15. margin
  16. the line round the box
  17. 176
  18. 310
  19. False
  20. 318
  21. False
  22. content
  23. 142
  24. False
  25. a solid or dotted edge
  26. True
  27. 292
  28. 180
  29. 220
  30. False
  31. space inside the border
  32. False
  33. border
  34. 122
  35. 208
  36. 276
  37. 156
  38. 84
  39. True
  40. 206

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