← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 92
  2. 114
  3. content
  4. the text or picture
  5. 108
  6. 160
  7. padding
  8. False
  9. 290
  10. 342
  11. False
  12. 268
  13. border
  14. 276
  15. margin
  16. border
  17. the gap to other boxes
  18. 296
  19. 106
  20. False
  21. 202
  22. the gap round content
  23. True
  24. 340
  25. 220
  26. 170
  27. 198
  28. space outside the border
  29. 102
  30. False
  31. 88
  32. 316
  33. 164
  34. False
  35. 262
  36. False
  37. True
  38. 332
  39. 144
  40. 78

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