CSS Menu highlighting current page

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
vidal
Forum Newbie
Posts: 1
Joined: Sat Jun 20, 2009 3:18 am

CSS Menu highlighting current page

Post by vidal »

I'm writing a small static site and I've got a navigation menu as an unordered list with CSS styling. I am styling the menu to highlight the current page using a different class to the rest of the menu. I usually use <?php include('navigation.html'); ?> an external navigation file so that changes to the site structure can be added globally. Is there an easy way to use php to read the current page and style the list appropriately?

James
terier
Forum Newbie
Posts: 9
Joined: Sat Jun 20, 2009 4:58 am

Re: CSS Menu highlighting current page

Post by terier »

Code: Select all

$page = basename($_SERVER['PHP_SELF']);
Post Reply