Is there a way in HTML / CSS to change the color of only one element of the list, not all? I just want to change the color of each of them so that the user knows which page it is on. so far I have managed to do only a:hover , but I canβt understand how I can do this so that the color remains.
HTML:
<div id="nav"> <div class="wrapper"> <ul id="buttons"> <li><a href="index.html">| About</a></li> <li><a href="html/gallery.html">| Gallery</a></li> <li><a href="html/prices.html">| Prices</a></li> <li><a href="html/faq.html">| FAQ</a></li> <li><a href="html/contact_us.html">| Contact Us</a></li> <div class="clear"></div> </ul> </div> </div>
CSS
#buttons { background-color: black; } .clear { clear: both; } #buttons li a { position:block; color:#fff; padding:1em; text-decoration:none; float:left; width:95px; } #buttons li a:hover { background-color:#bc1b32; }
source share