Despite several attempts, I am unable to change the color of the hyperlinks in blue or purple using the HTML and CSS below. Can anyone point out what I might be missing?
nav ul {
/* Navbar unordered */
list-style: none;
text-align: center;
background-color: #495e57;
border-radius: 10px;
}
nav li {
/* Navbar ordered */
display: inline-block;
padding: 20px;
font-size: 1.5rem;
border-radius: 10px;
}
nav li:hover {
/* Navbar on mouse hover */
background-color: #1f2926;
color: white;
}
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="menu.html">Menu</a></li>
<li><a href="book.html">Book</a></li>
<li><a href="about.html">About</a></li>
</ul>
</nav>
I have experimented with adding !important without success. So far, the only working solution I discovered is embedding the styles directly within the HTML code like this:
<li><a style="color: white" href="index.html">Home</a></li>