2015-11-30 58 views
0

我想要這3個div(或者我應該製作一個)左邊的一張照片,一個居中,另一個放在容器的左上角。 現在,我有這樣的: The problem圖片庫顯示/對齊

HTML:

<div id="gallery"> 
        <div class="foto"></div> 
        <div class="foto"></div> 
        <div class="foto"></div> 
      </div> <!--Gallery END --> 

CSS:

.foto { 
    display: inline-block; 
    position: relative; 
    width: 300px; 
    height: 200px; 
    background: white; 
    border: 5px solid; 
    border-color: #0BB5FF; 
} 
#gallery { 
    margin: 10px 0px 10px 0px; 
} 

謝謝解答!根據您的頁面

margin-top: 5em; 
margin-left: 16em; 

你可以改變你的價值:

+0

此問題似乎與此類似 - http://stackoverflow.com/questions/2603700/how-to-align-3-divs-left-center-right-inside-another-div –

+0

use「left :70%;「根據您的願望 – user3440716

+0

嘗試'width:32.9%;'in'.foto'並移除高度值 – pokeybit

回答