2015-04-04 391 views
1

我有一個圖像作爲背景,我試圖從Bootstrap使用col-放置更多的圖像與背景重疊,但我不能因爲重疊效果我設置position圖像到absolute,我認爲這是造成問題,'col-'不起作用。下面是代碼:Bootstrap與重疊圖像

HTML: 

<img src="imag/bgimage.png" class="bg"> 

<div class="text-center"> 
<div class="col-md-3 inline-block overlap"> 
    <article> 
     <img src="imag/image1.png"> 
    </article> 
</div> 
<div class="col-md-3 inline-block overlap"> 
    <article> 
     <img src="imag/image2.png"> 
    </article> 
</div> 

CSS: 
.bg { 
width: 100%; 
height: 100%; 
opacity: 0.5; 
} 

.overlap { 
position: absolute; 
z-index: 1; 
} 

.inline-block { 
float: none; 
display: inline-block; 
} 

回答

0

嘗試使父容器的位置relative