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 Use Classes in CSS

Why won't my nav links change colors when i hover?

a { text-decoration: none; }

wrapper {

max-width: 940px; margin: 0 auto; padding: 0 5%; }

logo {

text-align: center; margin: 0; }

a { color: #6ab47b; }

header { background: #6ab47b; border-color: #599a68; }

h1, h2 { color: #fff; }

nav { background: #599a68; }

nav a, nav a:visited { color: #fff; }

nav a.selected, nav a:hover { color:#32673f; }

a { text-decoration: none; }

wrapper {

max-width: 940px; margin: 0 auto; padding: 0 5%; }

logo {

text-align: center; margin: 0; }

a { color: #6ab47b; }

header { background: #6ab47b; border-color: #599a68; }

h1, h2 { color: #fff; }

nav { background: #599a68; }

nav a, nav a:visited { color: #fff; }

nav a.selected, nav a:hover { color:#32673f; }

10 Answers

Your "about" and "contact" nav links do change from white to green on hover, when I preview your code. The "portfolio" link is already green because its class is "selected" and that class is assigned the same color as "nav a:hover" in your css rule:

nav a.selected, nav a:hover { color:#32673f; }

Also, if you click the Markdown Cheatsheet link on this page, you can see how to post code that is formatted more clearly.

Can you post your HTML as well? The CSS you posted looks like it should work.

'''html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>John Richter | Web Development</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html" id="logo"> <h1>John Richter</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <div id="wrapper"> <section> <ul> <li> <a href="img/numbers-01.jpg"></a> <img src="img/numbers-01.jpg" alt=""> <p>Experimentation with color and Texture</p> </li> <li> <a href="img/numbers-02.jpg"></a> <img src="img/numbers-02.jpg" alt=""> <p> Playing with Blending Modes in Photoshop.</p> </li> <li> <a href="img/numbers-06.jpg"></a> <img src="img/numbers-06.jpg" alt=""> <p>Trying to create an 80's style of glows.</p> </li> <li> <a href="img/numbers-09.jpg"></a> <img src="img/numbers-09.jpg" alt=""> <p>Drips created using Photoshop Brushes.</p> </li> <li> <a href="img/numbers-12.jpg"></a> <img src="img/numbers-12.jpg" alt=""> <p>Creating shapes through repitition.</p> </li> </ul> </section> <footer> <a href="http://twitter.com/richter313"> <img src="img/twitter-wrap.png" alt="Twitter Logo"></a> <a href="http://facebook.com"> <img src="img/facebook.png" alt="Facebook Logo"></a> <p>© 2016 John Richter.</p> </footer> </div> </body> </html> '''

also why won't my "code" ... code. lol i tried to color code it the post for you using the markdown cheat sheet, any idea why its not working?

It looks like you used three single quotes instead of a backtick symbol. On a Mac, the backtick symbol (`) is on the same key as the tilde (~).

any idea why it wouldn't work for me on my machine?

also i want to try this

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>John Richter | Web Development</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>
    <header>
      <a href="index.html" id="logo">
        <h1>John Richter</h1>
        <h2>Designer</h2>
      </a>
      <nav>
        <ul>
          <li><a href="index.html" class="selected">Portfolio</a></li>
          <li><a href="about.html">About</a></li>
          <li><a href="contact.html">Contact</a></li>
        </ul>
      </nav>
    </header>
    <div id="wrapper">
      <section>
        <ul>
          <li>
            <a href="img/numbers-01.jpg"></a>
            <img src="img/numbers-01.jpg" alt="">
            <p>Experimentation with color and Texture</p>
          </li>
            <li>
            <a href="img/numbers-02.jpg"></a>
            <img src="img/numbers-02.jpg" alt="">
              <p> Playing with Blending Modes in Photoshop.</p>
          </li>
           <li>
            <a href="img/numbers-06.jpg"></a>
            <img src="img/numbers-06.jpg" alt="">
             <p>Trying to create an 80's style of glows.</p>
          </li>
           <li>
            <a href="img/numbers-09.jpg"></a>
            <img src="img/numbers-09.jpg" alt="">
             <p>Drips created using Photoshop Brushes.</p>
          </li>
           <li>
            <a href="img/numbers-12.jpg"></a>
            <img src="img/numbers-12.jpg" alt="">
             <p>Creating shapes through repitition.</p>
          </li>
        </ul>
      </section>
      <footer>
        <a href="http://twitter.com/richter313">
          <img src="img/twitter-wrap.png" alt="Twitter Logo"></a>
        <a href="http://facebook.com">
          <img src="img/facebook.png" alt="Facebook Logo"></a>
        <p>&copy; 2016 John Richter.</p>
      </footer>
    </div>
  </body>
</html>

hmm now its working wierd.

It's possible that the workspace just wasn't refreshing properly. Seems to happen sometimes. Nice job posting the code!

ian truong
ian truong
4,685 Points

I have the same issue. my hoover state doesn't change colors when I hoover over it. but I guess its because of a technical issue.