Tribte site questions

The example tribute site:

  1. Why are the styles set on both html and body?

  2. Why is the border set to 0px on main?

  3. If html/body are set to text-align:center; then why does img need margin:auto;? I thought the children should inherit the traits of the parents.

  4. Why do the instructions insist on giving every element an id when the example does not use them all?

  5. When I copy/paste the pen url into the solution field
    https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-projects/build-a-tribute-page
    it passes, even when I haven’t completed all the tasks. Like, if I don’t have any CSS at all…

Thanks for any help with these.

  1. The text-align property in CSS is used for aligning the inner content of a block element. Images don’t have any inner content which is why we either have to wrap it in a block and use text-align, or use auto margins.

  2. My best guess is so the project tester can read and evaluate our code better.

1 Like