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.
You should follow me on Twitter here I'll tweet about JavaScript, HTML 5 and other such gems (amongst usual tweet-splurges)
Introducing HTML5
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 :
hi ,
why don't you use just conditionnal comments or !important to erase border and increase padding of 2 pixel ?
ex: with !important :
since transparent is not understood by IE6 , color takes defaut value , so text-color
. The funny thing is that it still gets part of it (border-style & border-size) .
Little late to answer , but just got lost here
Just remenber , if one rule is not understood , the previous or default value will be used .
opacity , radius , box-shadow , ....for instance (tempting to use hey ! ,
) :
declare first the one that would be understood by older or specific browser then regular one:
Once older browser gets update , it might turn to the right one if it stands last without express need to clean CSS.
Conditionnal Comments are really usefull for those funny IEs .
GC
aaahhh! i've been searching for this code but for making text transparent itself ^_^
when i use
input{color:transparent}
input:hover{color:plum}
it works well with GC, FF, Opera, Safari but IE(text color is black always). i was so sad till i found this on your page \_/7 have a nice day