Hi Everyone,
I am using a included PHP menu on a website I am developing, and I need to get a:active working so that the current page is highlighted on the menu.
I found this little tutorial for doing it, however it dosent work:
http://webdevjunk.co...tive-page-link/
Does anyone have any ideas how to get this working?
Zach
Page 1 of 1
PHP Menu Include and a:active CSS
#2
Posted 04 January 2010 - 04:55 PM
This is one way I did it years ago:
In your header.php replace your <body> tag with this:
Imagine this is your "homepage"
That will give <body id="homepage"> only when the homepage is open.
Each menu item should have a unique class:
In your header.php replace your <body> tag with this:
<?php if (!isset($body) ); print '<body '.$body.'>'; ?>
Imagine this is your "homepage"
<?
$body = "id=\"homepage\"";
include("header.php");
?>
<div>Homepage content.</div>
<? include("footer.php") ?>That will give <body id="homepage"> only when the homepage is open.
Each menu item should have a unique class:
<a href="index.php" class="homepagelink">Home</a> <a href="about.php" class="aboutpagelink">About</a>
#homepage a.homepagelink, #aboutpage a.aboutpagelink {background:#000; color:#fff;}
Share this topic:
Page 1 of 1
Help
















