← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 264
  2. the text or picture
  3. space outside the border
  4. 238
  5. 298
  6. 160
  7. 182
  8. border
  9. False
  10. 260
  11. False
  12. False
  13. space inside the border
  14. 234
  15. False
  16. 316
  17. 154
  18. the gap round content
  19. True
  20. True
  21. 220
  22. 108
  23. 170
  24. 262
  25. 208
  26. 148
  27. 230
  28. False
  29. 190
  30. margin
  31. 222
  32. 194
  33. 252
  34. margin
  35. 146
  36. 358
  37. 202
  38. 184
  39. 84
  40. 288

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