这是我如何做到的.
请参阅jsFiddle的一个工作示例
http://jsfiddle.net/MxQTz/2/
HTML
<p class="text">
Here is some text. This will be displayed beneath the black circle.
Here is some text. This will be displayed beneath the black circle.
<span class="circle"></span>
</p>
Run Code Online (Sandbox Code Playgroud)
CSS
.text {
text-align: center;
padding: 20px;
border: solid 1px #eee;
width: 200px;
position: relative;
}
.text .circle {
background-image: url("http://nontalk.s3.amazonaws.com/black-circle.png");
background-repeat: no-repeat;
background-position: 50% 50%;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* Here's where you set the opacity */
opacity: .5;
/* Here's where you set the opacity for the bad browser */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}
Run Code Online (Sandbox Code Playgroud)