IE CSS半透明的注意事项
建站知识 2021-07-03 08:42www.168986.cn长沙网站建设
在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里就不能透明了!
复制代码
代码如下:<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里就不能透明了!
上一篇:css 条件注释使用指南
下一篇:修复网页在IE8 下的显示兼容问题
长沙网站设计
- 如何进行东阳SEO关键词优化?
- 边坝哪有关键词排名优化:提升你的网站流量与
- 安国百度优化服务:提升您的在线可见性
- 阜康新手做SEO怎么做
- 山西seo网站排名关键词优化:提升您网站曝光率
- 临沂seo网站排名关键词优化:提高你的网站可见
- 广西SEO网站推广怎样付费比较合理
- 双辽SEO网站推广:提升你的网站可见性与流量
- 辽宁企业网站优化购买方式有哪些
- 提升宝清百度SEO排名的实用技巧与策略
- 静宁百度SEO排名:提升您网站曝光率的关键策略
- 彭州百度SEO排名的提升策略和实施指南
- 广南百度关键词SEO:提升网站排名的关键策略
- 辽宁关键词优化怎么做论坛营销
- 吉林百度seo排名如何做到让用户满意
- 内黄百度优化服务:提升在线可见性的关键