HighDots Forums  

IE6 custom css does not work

alt.html.tags alt.html.tags


Discuss IE6 custom css does not work in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alex D
 
Posts: n/a

Default IE6 custom css does not work - 01-18-2004 , 06:26 PM






Hi,

I'm using a custom style sheet in IE6 to override the funny
font and color use of websites, but have a problem with some
font colors.

Here is a part of my css:

:link {
text-decoration: none;
font-weight: normal;
color: blue ! important;
background: #CCFFFF ! important;
}

a:visited {
text-decoration: none;
font-weight: normal;
color: red ! important;
background: #FFE4E1 ! important;
}

a:active {
text-decoration: none;
font-weight: normal;
color: red;
background: #00FFCC;
}

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.

(In IE/Options, Font colors as specified on Web pages are
ignored)


Help!

ps - I had a lot of difficulty finding an example of such
sucking websites in my Favorites - another indication, I
think, these webmasters suck.)


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: IE6 custom css does not work - 01-19-2004 , 02:11 AM






"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




Reply With Quote
  #3  
Old   
Alex D
 
Posts: n/a

Default Re: IE6 custom css does not work - 01-19-2004 , 03:17 PM



It works now - thanks a lot!

-alex-

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.