← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. padding
  3. the gap round content
  4. False
  5. 334
  6. 160
  7. 212
  8. 302
  9. 174
  10. 202
  11. content
  12. a solid or dotted edge
  13. margin
  14. 62
  15. True
  16. the gap to other boxes
  17. 156
  18. False
  19. 304
  20. 308
  21. border
  22. 102
  23. 332
  24. 230
  25. 122
  26. 102
  27. space outside the border
  28. 348
  29. True
  30. 154
  31. border
  32. 246
  33. True
  34. 314
  35. True
  36. 138
  37. 342
  38. 184
  39. the text or picture
  40. 230

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