Email conversation
From | Otto Manninen |
To | Me |
Subject | question concerning Nested list collapsing script |
Date | 6 May 2007 09:07 |
Hi Mark,
I have been looking for a good vertical menu collabsing script and your
Nested list collapsing script is awesome. The menustate cookie and
selfLink highlight are really great. But I'm having a problem when trying to
apply textcolor to highlighted state.
A URL where I´m trying to use it: [URL]
I want to set the font color in highlighted state:
(selfLink('someID','selfhighlight',true);)
I'm having problems with styling:
.selfhighlight{
border-bottom:1px outset #fff;
border-top:1px outset #fff;
background: #0b75af;
//color:#FF9900; this dosnt work
}
I tried to figure out the listCollapse.js, but didnt understand what causes
this. Not a major issue but still.
Thanks in advance for your help,
Otto
From | Me |
To | Otto Manninen |
Subject | Re: question concerning Nested list collapsing script |
Date | 6 May 2007 22:39 |
Otto,
> .selfhighlight{
> ...
> //color:#FF9900; this dosnt work
Your other CSS rules are more specific, and are overriding the colour
change. These rules are the ones causing problems:
#someID li a, #someID li a:hover {
...
color:#ffffff;
...
}
#someID li ul li a:hover {
color:#ff9900;
...
}
I suggest you take a look at the part of the CSS spec that deals with
specificity of rules - it should help to explain why these rules override
the colour you want to use:
http://www.w3.org/TR/CSS21/cascade.html#specificity
In most browsers you should be able to influence it by using this:
.selfhighlight{
color: #FF9900 !important;
No promises for IE 6- though, since it's implementation of !important is
badly broken. It may work, it may not.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/