Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmohannedshehri
1,101 PointsDescendant 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
Tunde Adegoroye
20,597 PointsNo 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