2013-06-12 149 views
-3

我正在使用圖像庫,其中外部寬度爲100%。但由於圖像圖像位置是絕對的,因此圖像將向左對齊。我正在努力使對齊的中心PLZ幫助我。絕對位置圖像對齊中心

外DIV + CSS代碼:圖像的CSS

.wt-rotator .screen { 
    height: 500px !important; 
    left: -5px; 
    position: relative; 
    top: -11px; 
    width: 100% !important; 
} 

風格:

.wt-rotator .main-img { 
    border: 0 none; 
    display: none; 
    left: 0; 
    padding: 0 !important; 
    position: absolute; 
    top: 0; 
    z-index: 0; 
} 

感謝。

+1

離不開一個例子或代碼幫助... –

+1

你爲什麼不刪除的位置是:絕對的風格呢? – Yami

+0

然後橫幅應該是正確的...看代碼 –

回答

0

嘗試增加CSS屬性{left: 50%; right: 50%;}