← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 166
  2. 234
  3. 194
  4. 262
  5. border
  6. 96
  7. 252
  8. 378
  9. 236
  10. border
  11. 114
  12. 144
  13. the text or picture
  14. 260
  15. space outside the border
  16. False
  17. 370
  18. the gap round content
  19. True
  20. False
  21. False
  22. 150
  23. True
  24. False
  25. 242
  26. 218
  27. padding
  28. 278
  29. 224
  30. True
  31. 86
  32. 74
  33. padding
  34. False
  35. margin
  36. 228
  37. 244
  38. 224
  39. the gap to other boxes
  40. content

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