← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 312
  3. False
  4. 132
  5. border
  6. content
  7. 192
  8. padding
  9. 116
  10. 102
  11. 122
  12. 304
  13. 318
  14. False
  15. 180
  16. 126
  17. 160
  18. 204
  19. 116
  20. padding
  21. 308
  22. the text or picture
  23. 138
  24. 170
  25. True
  26. margin
  27. 82
  28. 100
  29. 172
  30. 226
  31. margin
  32. space inside the border
  33. 152
  34. 222
  35. 200
  36. 184
  37. 252
  38. 336
  39. 140
  40. 304

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