I am making a website as part of a college assignment. I have a navigation list for my pages styled using CSS so when a page is selected the link appears bold with an image beside. I was wanting to keep the style of this menu however move this part of the html code to a .php file and just include it on each of the pages for code re-use.
Easy enough to do however because I have a class set to determine which page is selected an change the look of the link how would I go about passing this to the PHP file - Is it possible?
Code snippets below...
HTML list currently:
<ul>
<li class="selected"><a href="index.html">Home</a></li>
<li><a href="login.html">Members Login</a></li>
<li><a href="#">Music Categories</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
CSS for the selected page:
nav ul li.selected a
{
color:#fff;
font-weight:bold;
background:url(images/music_note2.png) center left no-repeat;
}
Is there some sort of code I can use the pass the name of the page? Appologies I have never used php. Not sure if it matters but later on I will need to also hide or show certain links on the menu depending on whether the user is logged in