← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. space inside the border
  3. 186
  4. True
  5. 182
  6. padding
  7. the text or picture
  8. False
  9. 94
  10. space outside the border
  11. the gap round content
  12. padding
  13. 268
  14. 146
  15. False
  16. 350
  17. 188
  18. 122
  19. True
  20. 124
  21. 162
  22. 230
  23. 258
  24. 280
  25. 330
  26. margin
  27. True
  28. 106
  29. True
  30. 334
  31. 96
  32. 190
  33. the gap to other boxes
  34. border
  35. 90
  36. False
  37. 330
  38. False
  39. False
  40. 286

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