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 Basics (2014) Basic Selectors Pseudo-Classes

My a:link isn't working. I've typed it out perfectly and all my links are light blue instead of orange. What's wrong?

I typed,

a:link { color: orange; }

and none of the links appear orange. It's frustrating how simple this is and still screwing up.

3 Answers

Erik - I had the same issue.

I am assuming that you did not open up a new workspace when starting the "Pseudo-Classes" video.

If you kept working and adding to a workspace that you opened in previous videos, within index.html, the href does not have an attribute.

For more info, please see the following video starting at 1:56: http://teamtreehouse.com/library/css-basics-2/basic-selectors/pseudoclasses-3

For example,

 <a href="#">Find out more</a>

will not work because it does not have an attribute. You'll need to add the following attribute for the first link to work.

<a href="#more">Find out more</a>

You'll also need to make changes to the following:

<a href="#wildlife">See the Wildlife</a>

<li><a href="#hotels">Lake Tahoe Resort Hotel</a></li>
<li><a href="#resorts">South Lake Tahoe Resorts</a></li>
<li><a href="#lodging">Tahoe Ski Resort Lodging</a></li>

Thank You!

Thanks. This had me frustrated as well. -A sublime text user

Colin Bell
Colin Bell
29,679 Points

:link is the pseduo-selector for an unvisited link. So if you've visited all of the links on the page, they're going to be the styled according to the browser's default a:visited styling (Unless you declare your own a:visited styles).

Kailash Seshadri
Kailash Seshadri
3,087 Points

ohh that makes sense thanks!!

You dont need the :link just 'a'. Adding the :link is the selector for unvisited links. :visited is for visited links, :active is for active links and :hover is for hovered links.

a { color: orange; }

and

a:active { color: orange; }

a:link { color: orange; }

a:visited { color: orange; }

a:hover { color: orange; }