I want to use <?php include 'header.php';?>
to include a header for every page of my website, so that I only need to change the header on one place. The website will reuse the header on more than 20 different pages in total. What I am wondering is how I can change the specific highlighted text when using php include?
I have created a website which has a header with 5 links (Home, Portfolio, About, Contact and Store). Currently I am using CSS code to show the user what part of the site they are on by highlighting the selected link (Page).
In the example below the Home "link" is highlighted in white. (See CSS code below.)
The following code is in the header:
<nav>
<ul>
<li><a id="selected" href="index.html">Home</a></li>
<span>|</span>
<li><a href="portfolio.html">Portfolio</a></li>
<span>|</span>
<li><a href="about.html">About</a></li>
<span>|</span>
<li><a href="contact.html">Contact</a></li>
<span>|</span>
<li><a href="store.html">Store</a></li>
</ul>
</nav>
CSS Code:
/* Selected Link */
#selected {
color: white;
}
Do I require some code that detects parts of the website or can I manually manipulate the highlighted link in some easy way? What would be the best practice for this sort of thing. Thank you for any input.