← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 176
  3. padding
  4. the text or picture
  5. margin
  6. padding
  7. border
  8. 162
  9. space outside the border
  10. True
  11. content
  12. 288
  13. False
  14. margin
  15. True
  16. the gap round content
  17. 262
  18. 288
  19. True
  20. 284
  21. the line round the box
  22. 106
  23. 146
  24. False
  25. 290
  26. a solid or dotted edge
  27. 198
  28. 204
  29. 134
  30. True
  31. 284
  32. 182
  33. 224
  34. 176
  35. 134
  36. 148
  37. True
  38. 164
  39. 272
  40. 288

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