← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. the line round the box
  3. the gap round content
  4. 124
  5. 238
  6. False
  7. the text or picture
  8. False
  9. padding
  10. 156
  11. space outside the border
  12. 96
  13. 338
  14. 158
  15. 328
  16. 206
  17. 192
  18. True
  19. 332
  20. True
  21. 220
  22. True
  23. 294
  24. 168
  25. 350
  26. space inside the border
  27. content
  28. 246
  29. False
  30. a solid or dotted edge
  31. 260
  32. 108
  33. 230
  34. 354
  35. 264
  36. the gap to other boxes
  37. border
  38. 260
  39. 264
  40. 140

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