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

HTML How to Make a Website Customizing Colors and Fonts Organize CSS with Comments

Ashot Hakobyan
Ashot Hakobyan
452 Points

Why my selected anchor doesn't change its color when it is in a state of being selected?

Hello friends, can anyone indicate on my mistake because I can't find the problem why it is still white. I select Portfolio but it is still white, not green as it is in the video. Thanks a lot for your time. P.S. Below are my html and css codes.

https://w.trhou.se/c4y7vu0qxb

https://w.trhou.se/d2cxv6k3t9

1 Answer

Adam Sumner
Adam Sumner
36,695 Points

Hi Ashot,

Your CSS shows that the link text should display green both on on hover and if the class 'selected' is apply to it.

Therefore for the home page your navigation should look like this:

<nav>
  <ul>
    <li><a class="selected" href="index.html">Portfolio</a></li>
    <li><a href="about.html">About</a></li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</nav>
Ashot Hakobyan
Ashot Hakobyan
452 Points

Hey Adam, thank you so much. Up to now I was unable to detect the problem. You did me a great favor, thank you!!!