user2924752
user2924752

Reputation: 93

How to change font color inside nav element?

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?

Upvotes: 4

Views: 38464

Answers (2)

Rahul Tripathi
Rahul Tripathi

Reputation: 172448

Are you looking for this:

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

#Nav a:hover {
    color: blue;
    text-decoration: underline;
}

Upvotes: 6

ZippyV
ZippyV

Reputation: 13028

#Nav a {
    color: #f2f2f2;
}

#Nav a:hover {
    color: red;
    text-decoration: underline;
}

Upvotes: 0

Related Questions