← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. content
  3. 134
  4. the text or picture
  5. 274
  6. 244
  7. 356
  8. 118
  9. 90
  10. margin
  11. 312
  12. padding
  13. False
  14. 210
  15. border
  16. 200
  17. False
  18. 352
  19. 276
  20. True
  21. 126
  22. 84
  23. 246
  24. 178
  25. False
  26. False
  27. 206
  28. 228
  29. the gap round content
  30. 340
  31. space inside the border
  32. 220
  33. False
  34. 116
  35. 70
  36. 202
  37. 218
  38. 278
  39. False
  40. 284

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