首先看看A级浏览器所支持的用CSS实现元素透明的方案:
浏览器 | 最低 版本 | 方案 |
---|---|---|
Internet Explorer | 4.0 |
|
5.5 |
| |
8.0 | | |
Firefox (Gecko) | 0.9 (1.7) |
|
Opera | 9.0 |
|
Safari (WebKit) | 1.2 (125) |
|
实际上在IE8中,-ms-filter是filter的别名,两者区别是-ms- filter的属相值必须被单引号或双引号包围,而filter中则不是必须,而在IE8之前的版本中,filter的属性值必须不被单引号或双引号包围。
IE中的HTML元素要实现透明,则其必须具备layout,这样的元素有仅可读的属性hasLayout,且其值为true。具体情况如下:
body
、img
、table
、tr
、th
、td
等元素的hasLayout
一直为true
。type
为text
、button
、file
或select
的input
的hasLayout
一直为true
。{position:absolute}
的元素的hasLayout
为true
{float:left|right}
的元素的
新闻热点
疑难解答