Highlight Active Link in Auto Nav

Permalink 3 users found helpful
I'm trying to get the active page of my site to have the relevant link in the Auto Nav to be red to show what page the viewer is on.

At the moment I can achieve this effect with this code:

ul.nav li ul li a.nav-path-selected, ul.nav li a.nav-path-selected{color:#EC1C24; text-decoration:none;}


However when we're on a child page this highlights both the child page and its parent page. If I remove the first part of the code

ul.nav li ul li a.nav-path-selected,


then when we're on one of those parent pages it doesn't get highlighted in red.

Does anyone know how I could just have the active page link in red in both situations?

 
Mnkras replied on at Permalink Best Answer Reply
Mnkras
just use the class nav-selected
Mnkras replied on at Permalink Reply
Mnkras
also, just do .nav-selected you don't need all the li and ul stuff since nothing else will have the class,
olivercoquelin replied on at Permalink Reply
Hi Michael. Thanks for the reply. That makes perfect sense but it doesn't seem to work for some reason. Here is the code I'm using:

.nav-selected {color:#EC1C24; text-decoration:none;}


And here's a link to the page:

http://newwebserver.santaferelo.com/beijing/...

Can you see from this what I'm doing wrong?

Thanks again.
Mnkras replied on at Permalink Reply
Mnkras
it looks like either those links are hardcoded or use a custom template, its hard to tell without the code
NUL76 replied on at Permalink Reply
NUL76
In your stylesheet you've got:

nav-path-selected{color:#EC1C24; }



Change this into (the dot at the start):

.nav-path-selected{color:#EC1C24; }
olivercoquelin replied on at Permalink Reply
Thanks for both your suggestions. In the end I had to use the following code to make it work:

ul.nav li ul li a.nav-selected, ul.nav li a.nav-selected{color:#EC1C24; text-decoration:none;}
Ihateit replied on at Permalink Reply
None of these suggestions work for me. I use the standard autonav, and i have added my own styles in style.css. What do i do :-D?

//Anders J.
NDorfer replied on at Permalink Reply
Try:

.nav-path-selected a {color:#EC1C24; }