← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space outside the border
  2. 244
  3. 142
  4. a solid or dotted edge
  5. margin
  6. 234
  7. 242
  8. the gap round content
  9. 196
  10. 224
  11. the text or picture
  12. margin
  13. 98
  14. False
  15. 268
  16. 172
  17. 214
  18. 206
  19. 186
  20. border
  21. 184
  22. 166
  23. 118
  24. 104
  25. 116
  26. True
  27. 86
  28. 336
  29. True
  30. True
  31. True
  32. 142
  33. the line round the box
  34. 138
  35. 112
  36. 244
  37. False
  38. True
  39. 352
  40. content

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