← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 342
  3. 290
  4. border
  5. 122
  6. 170
  7. False
  8. True
  9. 96
  10. the text or picture
  11. 238
  12. 222
  13. False
  14. 202
  15. 198
  16. False
  17. 228
  18. 330
  19. the line round the box
  20. True
  21. 212
  22. 130
  23. 206
  24. 164
  25. space inside the border
  26. False
  27. True
  28. False
  29. 242
  30. False
  31. True
  32. 122
  33. 344
  34. 202
  35. 116
  36. 174
  37. space outside the border
  38. margin
  39. 242
  40. 132

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