"Alex D" <no (AT) spam (DOT) sorry> wrote:
Quote:
The ! important is supposed to override color, but - to take
an example, in this page (http://www.atcevents.com/), see
the menu
on the left: light fonts on a dark background do not take
the color as specified in the css. |
I'm used to writing "!important" and not "! important", and I first
thought that the reason was the space. But after spending some time
with the CSS2 specification - it doesn't really say this except in the
formalized syntax, or actually in the code of a lexícal scanner - I
found that a space, or any whitespace, is allowed between "!" and
"important".
http://www.w3.org/TR/REC-CSS2/grammar.html says
"!{w}important" {return IMPORTANT_SYM;}
where w stands for any amount of whitespace.
So the explanation must be something different. On the page you
mention, the links you refer to contain font elements, e.g.
<td class="rightlinks"><a href="reg.html"
Quote:
font color="ffffff">Register
Now</font></a></td
|
And since there is nothing in your style sheet that sets properties for
the font element, the browser uses the properties set on the page. The
color="ffffff" attribute is presumably error-corrected by IE into
color="#ffffff" and then effectively mapped to its CSS counterpart,
setting the color property for font.
In theory,
font { color: inherit !important; background: inherit !important; }
should fix this, but IE does not support the inherit keyword.
But using
:link, :link * { ... }
:visited, :visited * { ... }
helps, since IE supports the universal selector *. These rules set the
properties for any element inside a link element.
Quote:
(In IE/Options, Font colors as specified on Web pages are
ignored) |
I must admit I don't know what that setting really causes. If I use the
technique I suggested, then your colors are imposed on the links when
that setting is _not_ checked (sounds OK since !important should
override page colors anyway), but when it _is_ checked, I get the
browser's default colors for anything, including those links.
(Or, actually, the colors set in the browser settings, ignoring any
style sheets.)
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html