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 trial

CSS CSS Foundations Selectors Link and User Action Pseudo-Classes

Link Element

To select all links in a page we can also use :link what is best to use?

:link {}


a:link {}

1 Answer

technically the anchor tag you are referring to is called a 'link' so you don't need the ":link" pseudo class to refer to links. You could just as easily select all links with this:

a {}

or this


or this


the only thing that ":link" does is select all unvisited anchor elements with an 'href' attribute (because not all anchor elements will always have an href attribute)