【发布时间】:2012-01-01 08:01:49
【问题描述】:
我正在使用以下 CSS 代码:
.rounded_box{
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
width:850px;
padding:15px;
background-color:#80C1FF;
margin:0 auto;
color: #0D2E47;
font-family: Arial,Helvetica,sans-serif;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
/* background-color:rgba(255,0,0,255); */
}
.rounded_box h1{
opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}
我想让 h1 和其他不透明的元素在 div 中具有类 rounded_box 。但也让 h1 和其他我不想要的元素变得透明。
那么有什么办法可以解决这个问题呢?
【问题讨论】:
-
使用 RGBA 值设置背景颜色...
-
只有 RGBA 不能在 IE8 及更早版本上工作
-
只设置背景属性来获得透明度,而不是使用
opacity属性。 This thread explains how.
标签: css transparency opacity