Reputation: 15
Here is my navigation bar as follows:
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="portfolio.html">PORTFOLIO</a></li>
<li><a href="resources.html">RESOURCES</a></li>
<li><a href="testimonials.html">TESTIMONIALS</a></li>
<li><a href="about.html">ABOUT</a></li>
<li><a href="contact.html">CONTACT</a></li>
</ul>
</nav>
And my CSS:
a: hover {
color: brown;
}
a: active {
color: #1490A5;
}
Im trying to have the active link in one colour and when I hover over it into another colour, its not working unfortunately
Upvotes: 0
Views: 78
Reputation: 1083
Remove the space between the two dots and the pseudo class
a:hover {
color: brown;
}
a:active {
color: #1490A5;
}
Upvotes: 3
Reputation: 462
There should be no space in the css elements, before :active and :hover, your code should be like this :
a:hover {
color: brown;
}
a:active {
color: #1490A5;
}
Upvotes: 0
Reputation: 12951
Remove gap between selector
and pesudo
:
a: hover {
^----------------Remove
a: active
^---------------Remove
a:hover {
color: brown;
}
a:active {
color: #1490A5;
}
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="portfolio.html">PORTFOLIO</a></li>
<li><a href="resources.html">RESOURCES</a></li>
<li><a href="testimonials.html">TESTIMONIALS</a></li>
<li><a href="about.html">ABOUT</a></li>
<li><a href="contact.html">CONTACT</a></li>
</ul>
Upvotes: 0