← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 120
  2. content
  3. padding
  4. 176
  5. 202
  6. space outside the border
  7. 138
  8. 122
  9. False
  10. True
  11. 152
  12. 218
  13. the text or picture
  14. 292
  15. 398
  16. 130
  17. 258
  18. False
  19. 240
  20. 228
  21. the gap to other boxes
  22. 148
  23. False
  24. 192
  25. 210
  26. 248
  27. padding
  28. 152
  29. 224
  30. border
  31. 120
  32. 126
  33. margin
  34. 232
  35. False
  36. 306
  37. 154
  38. the line round the box
  39. True
  40. 168

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