我已經爲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