我使用引導與HTML5一起開發一個網站。 我有一個網站標題。 我希望在網站標題中使用一些不透明度的圖片,並在其中添加一些文字。 我已經提到這個鏈接setting opacity for background image並嘗試實施它。我有文字,但沒有圖像。設置不透明度的背景圖像與網址在css
下面是代碼:
HTML:
<div class="page-header head">
<div class="hbg"></div>
Hi there
</div>
CSS:
.head{
position: relative;
z-index: 1;
margin-top:10px;
height: 170px;
}
.head .hbg
{
background: url('hbg.png');
background-size: 100% 100%;
opacity: 0.3;
z-index: -1;
}
什麼是這裏的問題?
「問題是什麼嗎?」那麼,你應該告訴我們... – feeela 2014-10-17 15:32:51