class for active page?

I was wondering if there's a class for active page. For example, if the active page is the same as the link, then use a particular class.

I know it's been done in the past by javascript, but I was wondering if CSS can do it now.

I've got a menu, and it has CSS rollover states (:hover) and I thought the :active state sounded like what I want, but it doesn't seem to do anything. The hover state can still work, but I'd just like to change the color, letting the visitor know that's the section they're in.

the active bit of the link is when you click on it and hold your mouse - so that brief second that it changes color it can be set (not too useful, but if you're really into colors and presentation then you can control it - it would also be the color if you tabbed onto the link...

there's no good way for css to evaluate what page it's on and show a style accordingly. what i often do is make a copy of my link style and add "On" to the style name and then (if it's php, etc. header), do the old if script name == page url then also echo "On" to the css class - then the right style is called for that page and it shows as on...

is that what you were thinking of? sounds like you already knew how to do it, though...

Well, I don't speak PHP but I can understand it I think. But I think my issue might be more complex than your example. I'm looking for a way to highlight the horizontal main menu links. So it has to look for a particular directory, not a specific page. To use the retail page as an example, the link is simply /retail. Which takes you to index.php. But I want it highlighted for all the pages in the retail section.

The links on the left already have this function because of the extension I purchased which creates the twirl down menus.

In the example you give, it seems that this is how it works... (the class I use is "biglinks")

class="biglinks(then you insert the script here that says if the current page is so and so then print "ON," otherwise, then print "" (nothing). That I understand. The script is filling in the end of the class with either ON or nothing, which will determine it's appearance. Exactly what I looking to do. What I don't understand is the $_SERVER['SCRIPT_NAME'] part. Is that a built in function, or am I to call on a script that will determine the page or directory I'm viewing?

[Bret Williams]"s that a built in function, or am I to call on a script that will determine the page or directory I'm viewing?"

the $_SERVER array is a built-in array in php that has a wide variety of useful parameters. you could figure out the directory by using that same script name param and the php dirname function (http://us2.php.net/dirname)...

you can find some other useful vars by making a dummy file and putting the php info at the top:

<?= phpinfo() ?>

you'll see all the params (and a bunch of other stuff) that php knows about each script. you can try putting the script in different dirs (say you do the above and save it as phpinfo.php) to see how the variables change...