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:
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
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?
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?
just use the class nav-selected
also, just do .nav-selected you don't need all the li and ul stuff since nothing else will have the class,
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:
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.
.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.
it looks like either those links are hardcoded or use a custom template, its hard to tell without the code
In your stylesheet you've got:
Change this into (the dot at the start):
nav-path-selected{color:#EC1C24; }
Change this into (the dot at the start):
.nav-path-selected{color:#EC1C24; }
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;}
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.
//Anders J.
Try:
.nav-path-selected a {color:#EC1C24; }
.nav-path-selected a {color:#EC1C24; }