← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. the line round the box
  3. 148
  4. 252
  5. 78
  6. padding
  7. the text or picture
  8. space outside the border
  9. False
  10. 70
  11. border
  12. border
  13. 230
  14. False
  15. False
  16. False
  17. content
  18. 200
  19. False
  20. True
  21. 120
  22. 224
  23. 164
  24. 208
  25. the gap round content
  26. True
  27. 128
  28. False
  29. 332
  30. 276
  31. False
  32. 272
  33. padding
  34. 320
  35. a solid or dotted edge
  36. 346
  37. 246
  38. 228
  39. 120
  40. 186

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