← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 328
  3. True
  4. False
  5. 358
  6. 144
  7. 298
  8. 100
  9. padding
  10. 332
  11. 220
  12. 320
  13. the text or picture
  14. False
  15. False
  16. space inside the border
  17. 370
  18. 172
  19. a solid or dotted edge
  20. border
  21. False
  22. True
  23. True
  24. the gap round content
  25. margin
  26. the gap to other boxes
  27. 120
  28. 328
  29. margin
  30. 244
  31. 244
  32. 116
  33. the line round the box
  34. False
  35. False
  36. 206
  37. padding
  38. space outside the border
  39. 174
  40. 268

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