← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 168
  2. space inside the border
  3. the gap round content
  4. 146
  5. the text or picture
  6. border
  7. 218
  8. a solid or dotted edge
  9. False
  10. 154
  11. 344
  12. False
  13. 110
  14. 300
  15. False
  16. 122
  17. space outside the border
  18. the line round the box
  19. 172
  20. 200
  21. 278
  22. 210
  23. True
  24. 304
  25. the gap to other boxes
  26. content
  27. 80
  28. 390
  29. False
  30. 110
  31. True
  32. False
  33. 190
  34. True
  35. 236
  36. True
  37. 162
  38. 192
  39. 142
  40. 126

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