2014-02-24 47 views
0

我不能讓我的形象我的DIV的底部(即自舉DIV了可能是造成問題的原因)我不能讓一個像我的引導DIV底部

<section id="page-portfolio"> 
    <div class="portfolio-item" id="item-1"> 
     <div class="col-sm-12 col-md-10"> 
      <img src="img/mac-devices-small.png" class="img-responsive"/> 
     </div> 
    </div> 

    <div class="portfolio-item" id="item-2"> 
     <div class="col-sm-12 col-md-10"> 
      <img src="img/mac-devices-small.png" class="img-responsive"/> 
     </div> 
    </div> 
</section> 

CSS:

#page-portfolio { 
    height: 1300px; 
} 

.portfolio-item { 
    height: 45%; 
    width: 100%; 
} 

#item-1 { 
    background-image: url("../img/client-fb.jpg"); 
    background-size: cover; 
    background-position: top; 
    position: relative; 
} 

#item-1 img { 
    position: absolute; 
    bottom: 0; 
} 

任何解決辦法的想法?

回答

0

您的div元素有「item-2」的id,但您的選擇器的目標是#item-1。更改CSS選擇要麼:

#item-1, #item-2 { ... } 
#item-1 img, #item-2 img { ... } 

或者:

.portfolio-item img { ... } 
+0

我禁用項目-2的圖像的定位,因爲我首先要修復部分-1的畫面。我應該註釋掉第2項。 – swennemen

相關問題