我不希望子元素繼承父級不透明度。 [請在此輸入鏈接的描述] [1]重置某個元素的子元素的不透明度
[1]:http://jsfiddle.net/xALAW/的jsfiddle
<html>
<head></head>
<body>
<div class='hasopacity'>
This is the text with some opacity
<div class='noopacity'>
This is the text with no opacity
</div>
</div>
</body>
CSS
.hasopacity{opacity:0.5}
.noopacity{opacity:1}
然後,據我所知,你必須讓它成爲兄弟姐妹而不是孩子。 – enhzflep 2013-02-23 08:06:21
看看http://stackoverflow.com/questions/806000/transparent-background-but-not-the-content-text-images-inside-it-in-css-on – 2014-02-27 08:42:08