我希望div內的圖像不透明,div必須透明。我試圖設置圖像和div的不透明度,但它不工作。無法控制div內的圖像的不透明度
的jsfiddle鏈接:http://jsfiddle.net/2BNEF/10/
我想要的圖像是不透明和文字在透明可見。
<div id="targetframe">
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes
<div id="target">
out. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their defaul
<img class="myimage" src="http://www4.picturepush.com/photo/a/1365552/480/trucks-photgraphy/asdf-%2858%29.jpg?v0"/>
</div>
</div>
#targetframe {
background: none repeat scroll 0 0 black;
border: 2px inset grey;
font-family: Verdana,sans-serif;
left: 0;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
top: 0;
opacity: 0.5;
}
#target {
background: none repeat scroll 0 0 transparent;
height: 100%;
left: 0;
position: relative;
top: 0;
width: 100%;
z-index: 0;
}
.myimage {
opacity: 1;
}
類似:[http://stackoverflow.com/questions/5662178/opacity-of-divs-background-without-affecting-contained-element-in-ie-8][1] [ 1]:http://stackoverflow.com/questions/5662178/opacity-of-divs-background-without-affecting-contained-element-in-ie-8 –