IE6 Issue - border-color:transparent not working

冷暖自知 提交于 2020-01-03 02:05:46

问题


style="border:solid 1px transparent" is not working in IE6 instead it shows a black border.

How to solve this issue?


回答1:


IE6 does not support a border that is transparent.

With a quick search, I found this workaround:

http://acidmartin.wordpress.com/2008/08/24/emulating-border-color-transparent-in-internet-explorer-6/

To put it to work with IE6, we will create another rule, that is visible only in version 6 (the *html hack) with just two lines of code:

*html .testDiv { 
    border-color: pink;
    filter: chroma(color=pink);
}

… And voila! The ugly black border around .testDiv magically disappears.

The final things you should have in mind before using this trick is the color (both border and chroma color) in the hack. Make sure you apply a border-color (and respectively use it in the chroma filter) that is not used in that div, as the chroma filter displays a certain color of the object and its content as transparent, i.e. if the border-color in the hack is orange, and the text in your element is orange as well, it will disappear when the orange chroma filter is applied.



来源:https://stackoverflow.com/questions/5714356/ie6-issue-border-colortransparent-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!