Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website CSS: Cascading Style Sheets Take a Mobile-First Approach

Descendant selectors and ID's

In this video we made the #logo ID, I understand how important ID's are and how they work, but in this case can we put a descendant selector header a { text-align: center; margin: 0; } instead of the ID logo? Thanks.

1 Answer

No because if you did that it would target all the anchor elements before an a the reason why the #logo is used because an id is specific to that element think of like your id number for treehouse no one else can have it so it's best to give elements that we specifically want to style an id selector and then target the anchor element that way we are applying a specific style rather than a general one that might be used in place that we don't want