Skip to main content
Known Participant
April 1, 2017
Answered

Not able to change color of text links

  • April 1, 2017
  • 4 replies
  • 460 views

I'm not sure why I can't get my text links at the top right to change color.  I'm trying to make them white, and then some other darker color for hover, but nothing I put in the CSS seems to work.

I have the code below and the site is live at here

(Im not sure why indent made this all a table, but I can't get rid of it now...) 

    <!--Right Side of Nav-->
    <div id="nav_container">
      
      <li>  <a href="/organdonor.html" >WORK</a> </li>
      
       <!--<li>  <a href="#">PROCESS</a> </li>-->
      
       <li>   <a href="/about.html"  >ABOUT</a>  </li>
     
       <span class="clearfix"></span>

      
   </div>
    

and the CSS:

/*right navigation elements and positioning*/

#nav_container {

  

    float: right;

    position: relative;

    padding-right: 110px;

    padding-top: 60px;

}

#nav_container li {

    float: left;

    display: inline;

    color: #fff;

    list-style: none;

    text-decoration: none;

    cursor: pointer;

  

}

         /*  Transition

-webkit-transition: All 0.75s ease;

-moz-transition: All 0.75s ease;

-o-transition: All 0.75s ease;

-ms-transition: All 0.75s ease;

transition: All 0.75s ease;

    */

#nav_container li:hover {

  text-decoration: underline;

  color: #5F5F5F;

}

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Nancy OShea

Links inherit the browser default styles.  If left un-specified, you get blue text for unvisited links and purple text for visited links.  To override those defaults, you must be very specific about what you're targeting.

Nancy

4 replies

Nancy OShea
Community Expert
Community Expert
April 1, 2017

Hyperlinked text is inside an <a> tag.  So add an a to your selector name

#nav_container li a {color:white}

Nancy O'Shea— Product User & Community Expert
danbennerAuthor
Known Participant
April 1, 2017

Thank you Nancy! That did the trick! (I'd assumed that anything inside the <li> would apply to every element within it. Good to know!!)

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
April 1, 2017

Links inherit the browser default styles.  If left un-specified, you get blue text for unvisited links and purple text for visited links.  To override those defaults, you must be very specific about what you're targeting.

Nancy

Nancy O'Shea— Product User & Community Expert