← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. True
  3. margin
  4. False
  5. 180
  6. 180
  7. the line round the box
  8. 170
  9. False
  10. 172
  11. 108
  12. 312
  13. 236
  14. 112
  15. 142
  16. 156
  17. 256
  18. 190
  19. 154
  20. 280
  21. the text or picture
  22. 202
  23. 160
  24. 278
  25. 242
  26. 168
  27. margin
  28. content
  29. 218
  30. 286
  31. border
  32. 320
  33. padding
  34. True
  35. True
  36. 146
  37. a solid or dotted edge
  38. 98
  39. True
  40. 144

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