← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 146
  2. 242
  3. 226
  4. True
  5. True
  6. True
  7. False
  8. the line round the box
  9. a solid or dotted edge
  10. True
  11. 96
  12. margin
  13. the gap round content
  14. 362
  15. False
  16. 358
  17. 180
  18. 188
  19. the text or picture
  20. 348
  21. 262
  22. content
  23. False
  24. 248
  25. 278
  26. 164
  27. padding
  28. 244
  29. 288
  30. 320
  31. 184
  32. border
  33. False
  34. padding
  35. 202
  36. False
  37. 270
  38. border
  39. 344
  40. 258

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