AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > css教程

IE CSS半透明的注意事项

51自学网 http://www.wanshiok.com
IE,CSS,半透明在IE下的半透明层,必须在样式里明确定义宽度或高度,才能出现半透明效果,否则无法半透明,如下

复制代码
代码如下:

<style type="text/css"><!--
.tm {
filter:alpha(opacity=50);
opacity: 0.5;
-moz-opacity:0.5;
background-color:#000000;
width:100%;
color:#ffffff;
}
.tp {
background-color:#ff00ff;
vertical-align: bottom;
height: 226px;
width: 140px;
}
--></style>
<style type="text/css" mce_bogus="1">.tm {
filter:alpha(opacity=50);
opacity: 0.5;
-moz-opacity:0.5;
background-color:#000000;
width:100%;
color:#ffffff;
}
.tp {
background-color:#ff00ff;
vertical-align: bottom;
height: 226px;
width: 140px;
}</style>
<table border="0" cellspacing="0" cellpadding="0" class="tp">
<tr>
<td valign="bottom">
<div class="tm">
asfasdfasd
</div>
</td>
</tr>
</table>

这个半透明是正常的,如果把样式tm的width:去掉,在firefox里依然正常透明,到了IE里就不能透明了!
IE,CSS,半透明  
上一篇:css 条件注释使用指南  下一篇:修复网页在IE8 下的显示兼容问题