← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 270
  2. 256
  3. True
  4. False
  5. 170
  6. padding
  7. the gap to other boxes
  8. 104
  9. 240
  10. space inside the border
  11. 214
  12. False
  13. 196
  14. 284
  15. the gap round content
  16. 238
  17. space outside the border
  18. False
  19. 280
  20. True
  21. padding
  22. False
  23. border
  24. 326
  25. True
  26. 152
  27. True
  28. 242
  29. False
  30. 344
  31. 142
  32. False
  33. 310
  34. 248
  35. the text or picture
  36. 132
  37. 162
  38. 108
  39. 134
  40. 270

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