treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Link styles

  • Hi, I´m having this big problem, and that its that i have a horizontal menu, and its background color is a green gradient, and over that I have some links and I want them to be white. Thats not the problem, the problem its that I also have a vertical menu that has the background set on white, but I want the links be a different color from white, so how can I make this possible?
    How can I have two different styles of color links?

    Thanks
    Jose.
  • Yes. That is the magic of selectors.

    That tells all links to be white
    a { color: white; } 


    If you give an ID to your navigations:

    <ul id=\"topnav\">
    <li><a href=\"#\">Home</a></li>
    <li><a href=\"#\">About</a></li>
    </ul>

    <ul id=\"sidenav\">
    <li><a href=\"#\">Home</a></li>
    <li><a href=\"#\">About</a></li>
    </ul>


    You can tell the links to be different colors depending on what ID (#) they are in:
    #topnav a { color: white; } 
    #sidenava { color: white; }
  • That was a really quick reply!! Thanks :D
    Its working :P
  • Excellent.

    You're welcome.