← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 186
  2. 234
  3. True
  4. False
  5. 122
  6. space outside the border
  7. margin
  8. 212
  9. 194
  10. the line round the box
  11. 154
  12. the text or picture
  13. True
  14. space inside the border
  15. 224
  16. content
  17. 240
  18. padding
  19. 208
  20. 242
  21. False
  22. 68
  23. False
  24. 100
  25. the gap to other boxes
  26. padding
  27. 284
  28. 186
  29. 134
  30. 212
  31. 126
  32. 172
  33. 312
  34. 210
  35. False
  36. 208
  37. 132
  38. 130
  39. 316
  40. 144

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