← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. False
  3. False
  4. 78
  5. 174
  6. the gap to other boxes
  7. space inside the border
  8. border
  9. the line round the box
  10. 96
  11. False
  12. the text or picture
  13. 178
  14. margin
  15. 170
  16. 148
  17. True
  18. 166
  19. 262
  20. 164
  21. 186
  22. 202
  23. False
  24. 242
  25. the gap round content
  26. content
  27. False
  28. 218
  29. 326
  30. 346
  31. 150
  32. padding
  33. 378
  34. 166
  35. 230
  36. False
  37. False
  38. 140
  39. 262
  40. 122

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