我已经为div设置了背景颜色和背景图片。如何将不透明度添加到背景图像,以便背景颜色也变得可见?将不透明度添加到背景图片
这里是我的代码:
CSS:
.box{
background-color: green;
background-image: url('http://farm8.staticflickr.com/7308/12305815623_3d1614042a_n.jpg');
background-repeat: no-repeat;
font-size: 40px;
width: 320px;
height: 200px;
}
HTML:
<div class="box">
<div class="wrap">Some text</div>
</div>
演示: http://jsfiddle.net/Yv6T3/
你可以做一点点的解决。看到这个:[透明背景图片](http://css-tricks.com/snippets/css/transparent-background-images/) – Itay
这已经回答gazillion次:http://stackoverflow.com/search?q= css +背景+不透明 – Joonas