Click to See Complete Forum and Search --> : Navbar styling - Current page link


wastlinger
11-18-2005, 05:43 AM
Will CSS allow me to style the link to the current page? Ie if I have five links in the navbar, and the the user has selected one of the links, and is viewing the page of that link, that particular link should be highlighted.

I want something similar to the navbar on
http://www.alistapart.com

My guess is that CSS alone cannot achieve this.

THanks in advance for any help

wastlinger

BonRouge
11-18-2005, 05:50 AM
You can do it with CSS alone, but I'd recommend using php... Like this (http://bonrouge.com/br.php?page=current).

wastlinger
11-18-2005, 07:48 AM
Hi BonRouge,

You have helped me in the past, but probably don't remember, as you very likely have helped many people. Anyway thanks again.

The problem is that I am trying for a entirely CSS solution as the site in question runs on a php application, that I don't have access to (or more to the point, I don't know php). I only control the presentation layer ie CSS.

How would this be possible with CSS? Why not just use CSS?

Thanks again for your help

BonRouge
11-18-2005, 12:03 PM
Paul O'Brien (http://pmob.co.uk) has a good example of this here (http://www.pmob.co.uk/temp/nav-body.htm). It involves giving the body tag an id (well, in this example, classes are used, but...) and using the cascade to style the appropriate link. Have a look at the code in the example and see if you can use it. If there's anything you don't get, let me know and I'll try to explain.

wastlinger
11-21-2005, 02:39 PM
Thanks for that. Makes sense. I just need to get my php to pass id tags. Thanks again for your help.