为什么使用此代码时,内部DIV也会变得透明?
我的计划是让文字可见和透明的背景。
我必须将透明div上的内部div浮起来吗?DIV上的透明背景
你可以看到现场演示在这里:http://jsfiddle.net/pBAf5/
HTML
<div class="openinghours floatRight">
<div class="content">My test goes here</div>
</div>
CSS
.openinghours {
height: 70px;
width: 300px;
padding: 10px;
font-size: 0.85em;
background-color: #f6f6f6;
border: solid 1px #c7c7c7;
margin-right: 20px;
margin-top: 5px;
opacity: .5;
filter: alpha(opacity=50);
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
RGBA:http://css-tricks.com/rgba-browser-support/和兄弟节点,您将需要使用绝对定位 – 2010-09-17 01:08:11
http://akshar.co.in/?p=57这里是基于RGBA的解决方案 – 2011-07-05 10:14:47