← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 106
  3. the text or picture
  4. 158
  5. the gap to other boxes
  6. border
  7. False
  8. False
  9. 308
  10. 252
  11. margin
  12. 130
  13. 216
  14. False
  15. 124
  16. False
  17. 246
  18. 196
  19. False
  20. the line round the box
  21. 296
  22. 190
  23. 310
  24. border
  25. 352
  26. 304
  27. 190
  28. 268
  29. space outside the border
  30. 148
  31. 108
  32. True
  33. content
  34. 198
  35. 210
  36. 150
  37. 180
  38. 254
  39. margin
  40. 226

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