2016-09-09 30 views
0

here's the site。如果將窗口大小調整爲較小。你會發現有引起Bootsrap轉盤:刪除下邊距

.carousel-inner { 
    background-color: #03324c; 
} 

底邊距/填充,我可以刪除,但該指標將是不可見的,並會出現在底部留有空隙。我知道,圖像有不同的大小,我嘗試調整大小,同樣的問題。我已經嘗試了很多東西2天,沒有任何工作。

.carousel-inner { 
    background-color: #03324c; 
} 
.carousel-inner img { 
    margin-left: auto; 
    margin-right: auto; 
    margin-top: auto; 
    opacity: 0.7; 
    width: 100vw; 
    height: auto; 
    max-height: 100vh; 
    bottom: 0; 
} 
.carousel-caption h3 { 
    color: #fff !important; 
} 
+0

究竟是什麼你在找什麼?您是否希望爲指標顯示保證金? –

+0

@SamBattat是的,我保持它,因爲它使指標顯示,這就是我需要的所有 – Lynob

+0

使所有圖像相同的寬度和高度 – marzelin

回答

1

你會更好使用background-image結合background-size:cover.item元素。

例如,您的第一項將改變這個(只是刪除img標籤):

<div class="item" style="min-height: 710px;"> 
    <div class="carousel-caption"> 
    <h3>New York</h3> 
    <p>The atmosphere in New York is lorem ipsum.</p> 
    </div> 
</div> 

而對於相應.item元素的造型會是這樣:

.item { 
    background-image: url(images/medium/quote.png); 
    background-size: cover; 
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    background-position: center; 
} 
+0

該方法的優點是什麼? – Lynob

+0

您可以輕鬆縮放圖像以填充容器的空間,同時保持原始圖像的比例。這就是說,當你使用不同大小的圖像時,或者圖像比例與容器比例差異很大時,你本質上有可能會切斷某些圖像 – feihcsim

+0

我認爲圖像大小不成問題,我認爲容器是或指標導致填充 – Lynob