I have the following HTML
code:
<div class="MenuContainer">
<div class="Menu">
<div class="MenuContents">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="gamePage.html">Game</a></li>
<li><a href="gameDesignPage.html">Game Design</a></li>
<li><a href="devRolesPage.html">Developer Roles</a></li>
<li class="float-right"><a href="about.html">About</a></li>
</ul>
</div>
</div>
</div>
How can I make it so that when one of the list items is selected the background colour changes even after the href
loads the new selected page therefore making it clear to the user what page they are on?
I have read many answers to similar stack overflow questions that generally use JQuery
to add a css
class
to the html
list item or anchor when clicked that changes the colour but it does not work for me, I feel like because the href
changes the page (loads a new page) everything is reset each time I select a list item and the colour never changes or perhaps only does so for a split second and I cant notice it?