← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 152
  2. margin
  3. True
  4. 306
  5. True
  6. 176
  7. False
  8. padding
  9. False
  10. a solid or dotted edge
  11. 144
  12. border
  13. 110
  14. 220
  15. the gap round content
  16. 216
  17. 112
  18. 274
  19. 276
  20. border
  21. 132
  22. True
  23. 344
  24. True
  25. 172
  26. False
  27. space outside the border
  28. 316
  29. 164
  30. padding
  31. 242
  32. False
  33. 182
  34. the gap to other boxes
  35. 146
  36. 136
  37. space inside the border
  38. 104
  39. the line round the box
  40. True

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