← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 168
  2. 280
  3. 316
  4. space inside the border
  5. the text or picture
  6. False
  7. 138
  8. 242
  9. 110
  10. False
  11. 196
  12. padding
  13. margin
  14. 232
  15. 112
  16. 250
  17. True
  18. 300
  19. 136
  20. 240
  21. 134
  22. 168
  23. border
  24. 314
  25. True
  26. 198
  27. 260
  28. 120
  29. 292
  30. 212
  31. content
  32. False
  33. padding
  34. the line round the box
  35. 160
  36. 314
  37. False
  38. 252
  39. True
  40. 100

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