← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. space inside the border
  3. 334
  4. the text or picture
  5. space outside the border
  6. margin
  7. 172
  8. 312
  9. 160
  10. False
  11. True
  12. 174
  13. padding
  14. 318
  15. 128
  16. 328
  17. border
  18. the gap round content
  19. 80
  20. 130
  21. 184
  22. 358
  23. False
  24. 118
  25. the gap to other boxes
  26. True
  27. 296
  28. 202
  29. padding
  30. 112
  31. 188
  32. 332
  33. True
  34. a solid or dotted edge
  35. 288
  36. 324
  37. 258
  38. 216
  39. 138
  40. border

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