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 The Selectors Solution

Amandeep Pasricha
Amandeep Pasricha
14,932 Points

Does nav a: and nav a:link target the same types of elements?

Tell me if I'm right: I'm guessing that nav:a targets content wrapped with <a> element, containing href attribute or not, correct, but Guil didn't feel the need to add the pseudoclass element :link?

In addition to the above question, when you write nav a, isn't there technically no pseudo-class present?

1 Answer

Steven Parker
Steven Parker
218,694 Points

The final target in a descendant selector is the item on the right, in this case "a". And plain "a" targets all anchors (links or not), where "a:link" targets the unvisited links (anchors with href and that have not been used).

And yes, "nav a" is a descendant selector that is using only tag names.