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

Can't Figure out where I am going wrong CSS- changing color of selected nav text and hover

I've doublechecked this like 10 times but its still not working. I'm trying to make the color of the selected nav text change and make the color of the text change with mouse hovers But its still not working... Here is the link to my workspace https://w.trhou.se/jtgea72lew

Also here are the lines of code HTML <nav> <ul> <li><a href="index.html" class="selected">Portfolio</li> </a> <li><a href="about.html">About</li> </a> <li><a href="contact.html">Contact</li> </a> </ul> </nav>

CSS

nav a.selected, nav a:hover { color: #98005e; }

Alexandra I believe your problem is that you do not need to include "nav a" to target your "selected" class. Try making it just ".selected."

2 Answers

Your problem is just a small syntax error. You are missing a closing curly brace for h2 in your CSS which is messing up the CSS statements that come after.

h2{
  color: #f7a606;

nav {
  background: #ffe9fb;
}

That solved the problem! Thank you so much!!