How to change font color inside nav element?

33,583

Are you looking for this:

#Nav a{
     color: #f2f2f2;
     text-decoration:none;
}

#Nav a:hover {
    color: blue;
    text-decoration: underline;
}
Share:
33,583
user2924752
Author by

user2924752

Updated on July 09, 2022

Comments

  • user2924752
    user2924752 almost 2 years

    I have a element and I want to change the color of the links within it, but all other links on my page are styled using the following CSS:

    a:link {
    
        color:#22b14c;
        text-decoration:none;
        }
    

    and here is the nav:

    <nav id="Nav">
            <a href="index.html">Home</a> |
            <a href="Gallery.html">Library</a> |
            <a href="Contact.html">Contact</a> |
            <a href="About.html">About</a>
    </nav>
    

    and the nav css:

    #Nav {
    
        margin-top: 20px;
        background-color: #000000;
        color: #f2f2f2;
        font-size: 40px;
        font-family: "Calibri";
        text-align: center;
        }
    

    I tried a span inside the nav element but that didn't work. How can I change the color for these links only inside the element?

  • user2924752
    user2924752 over 10 years
    how can I change the hover on this also?
  • user2924752
    user2924752 over 10 years
    that's it also is there a way I can change the hover?