I'm a newbie to drupal, and would really love to know how I can move the "active-trail" class designation from the "li" tag to the "a" tag. To simplify my problem... when I use the rule ul.nice-menu li.active-trail a { color: #FFF; }, it makes every link that is a child of the first .active-trail white too. I've tried to override this (and maybe I'm not clever enough), but it seems that I really need to be able to select only the link that has the class of "active-trail".

I'm not sure if this has been addressed before, but if it has, I'd really appreciate a link to the answer. I haven't been able to find anything.

I'm using 6.x-2.x-dev, and perhaps this could be a feature request for the final release.

Thanks for any help!

Comments

areikiera’s picture

It occurs to me that having the active-trail class on the li would be important if one of the menu items wasn't actually a link, but only a menuparent. Maybe that's why it's been placed on the li instead.

I'm guessing this could be done with CSS selectors (still learning), and perhaps I'm posting in the wrong forum if that is so. If not, and it would be best to move the class to the link, I'd love to know how.

Thanks again!

areikiera’s picture

When I write on these forums I tend to think of new ideas I haven't tried as I go, so I apologize for the naive post. I was right about using css selectors, and hopefully anyone else who falls into the same rut I did will find this useful.

Instead of using ul.nice-menu li.active-trail a { color: #FFF; } (which selects all of the links below the li.active-trail many levels down in the menu), I used ul.nice-menu li.active-trail > a (which selects only the link that immediately follows the list item with the active-trail class).

Thanks to anyone who read through this anyway : )

areikiera’s picture

Status: Active » Fixed

setting to fixed

Standart’s picture

This won't work in IE6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.