hi
I'm new to PHP...
I have a simple menu (home, about, newsletter etc) which are in the header.php file and included in each page.
Basically what I want to do is that when the user is on the "About" page the menu "About" link will have a background color to indicate that they are on that page (and the same for other pages).
What php code does this?
thanks
nathan
Change link color when on certain page?
Moderator: General Moderators
- darodesign
- Forum Newbie
- Posts: 19
- Joined: Mon Aug 28, 2006 8:58 am
- Location: Berlin
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Use CSS. Give the body a class that's individual to the various areas you wish to customize per page.
Code: Select all
body.about div.submenu
{
background-color: green;
}
body.index div.submenu
{
background-color: orange;
}Thanks guys, I managed to get it sorted here: http://www.sitepoint.com/forums/showthr ... ?p=3013477