← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 276
  2. margin
  3. 220
  4. 86
  5. the line round the box
  6. space outside the border
  7. 186
  8. margin
  9. 286
  10. padding
  11. padding
  12. False
  13. the text or picture
  14. 178
  15. 282
  16. 264
  17. 178
  18. False
  19. 290
  20. 248
  21. 208
  22. 124
  23. 326
  24. content
  25. 204
  26. True
  27. 130
  28. 178
  29. 160
  30. False
  31. False
  32. 112
  33. False
  34. 360
  35. border
  36. 156
  37. the gap to other boxes
  38. False
  39. True
  40. 272

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