Forum Moderators: not2easy

Message Too Old, No Replies

IE link colour bug? Maybe...

         

Gordon2004

8:29 am on Dec 7, 2003 (gmt 0)

10+ Year Member



Hey guys,

I'm new to CSS so shoot me down if this is stupid.

I've just created my first CSS site and am now trying to optimise my code.

The following causes links on the left of the page to be different colours. The top link is always yellow and the following linksare always white.
This code makes all links white in IE, but displays them correctly in Mozilla and Opera:

#yellowlefttext a:link, a:visited {
color: yellow;
text-decoration: none;
}

#whitelefttext a:link, a:visited {
color: white;
text-decoration: none;
}

If I do this:

#yellowlefttext a:link {
color: yellow;
text-decoration: none;
}

#yellowlefttext a:visited {
color: yellow;
text-decoration: none;
}

Then it works correctly in IE aswell.
It's not a major problem of course, was just wondering if I'm doing something wrong.

BlobFisk

1:25 pm on Dec 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Gordon2004,

Try:

#yellowlefttext a:link, #yellowlefttext a:visited {
color: yellow;
text-decoration: none;
}

When using commas to apply styles to multiple classes/id's, due to IE's buggy inheritance, apply the full ruling as above.

HTH

Gordon2004

2:32 pm on Dec 8, 2003 (gmt 0)

10+ Year Member



Hey Blobfisk,

Thanks, that works perfectly. I didn't know I hated IE till I started getting into web design...