IE6 reading text colour for border colour!
In creating a particularly complicated styling for a project I'm working on, I've come across a corker of a bug in IE6.
if (ie6) border-color = color
If you're using td { border-color: transparent; } (which I have to create this specific project effect), then IE6 will literally replace this with the colour of the text in the td.
I only noticed this because the colour of the text in my td is different to the background colour - and wham! In IE6, the border colour is taken from the text colour if borders are transparent.
See the example
View the example in Firefox, then view it in IE6 - classic!
http://jsbin.com/iquyi (to edit: http://jsbin.com/iquyi/edit)
Challenge?
If anyone is up to the challenge, have a crack at getting the transparency working (note that this needs to be on a td and not a div - for which I've seen a fix already).
The long solution is to use border-color: #fff; - but it not as easy as that in my situation since I got lots of different colours to deal with, and it would (and probably will) require a lot of additional, conditional, CSS.
one word... lol
haha! good one to know!
Cheers
IE 6 just doesn't support the value transparent for border-color, thus it is (correctly) inheriting the border's color from color.
I had the exact same problem a few months ago working on a site and it drove me absolutely bonkers! Unfortunately 80% of users on the project still use IE6. Doh!
@Klaus - damn! You're right. I understand now - since 'transparent' isn't recognised, it's looking for an alternative colour, rather than not colouring it at all:
http://www.w3.org/TR/CSS21/box.html#border-color-properties
did you consider using javascript to solve this?? I mean let it do the additional work..I'm still a beginner in this domain and when I get stuck with IE6 magic problems I use jQuery to do the work for me...
I tried this and it worked somehow...I don't know if this solution would help..this is what I tested, it's just a sample:
Remy, what about using an expression with a filter in the CSS? It's pretty hack-ish, but its kind of neat as well.
e.g.
I don't think that works, but you might be able to use a different expression or filter or summin...
http://msdn.microsoft.com/en-us/library/ms532853(VS.85).aspx
Remy you could increase the padding by 2px for when the border is transparent (padding 42px, border none). I'm guessing you want to change the border color to something either on hover or depending on some particular scenario?
"transparent" in IE6 is very strange. You can do like this :