2017-09-16 29 views
1

默認引導傳送帶的對照(左和右箭頭)具有跨越在轉盤的圖像的高度的100%的鏈接。我很抱歉,因爲這可能是一個愚蠢的問題,但你如何改變這種情況,以便鏈接僅在箭頭的寬度和高度上?如何更改自舉輪播控制鏈接的大小?

您可以在Boostrap文檔(https://getbootstrap.com/docs/3.3/javascript/#carousel)的「Carousel」下看到一個示例,並且該傳送帶的代碼位於下方。

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> 
    <!-- Indicators --> 
    <ol class="carousel-indicators"> 
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="1"></li> 
    <li data-target="#carousel-example-generic" data-slide-to="2"></li> 
    </ol> 

    <!-- Wrapper for slides --> 
    <div class="carousel-inner" role="listbox"> 
    <div class="item active"> 
     <img src="..." alt="..."> 
     <div class="carousel-caption"> 
     ... 
     </div> 
    </div> 
    <div class="item"> 
     <img src="..." alt="..."> 
     <div class="carousel-caption"> 
     ... 
     </div> 
    </div> 
    ... 
    </div> 

    <!-- Controls --> 
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> 
    <span class="sr-only">Previous</span> 
    </a> 
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
    <span class="sr-only">Next</span> 
    </a> 
</div> 
+0

「環節都只能通過自己的箭頭的寬度和高度,」你這是什麼意思呢? – Gagantous

+0

您可以編輯輪播控制類的css以便更改它們的大小。向.carousel-control類添加高度屬性。 – MUlferts

+0

o如果您正在談論的實際glyphicon圖標的大小,你可以添加一個類實際的圖標在這個問題上,以改變它的大小,如:https://stackoverflow.com/questions/18478365/bigger-glyphicons – MUlferts

回答

1

添加在兩個.carousel-control.left.carousel-control.right

//change the margin to make the width and height more longer or shorter 
    margin: 100px 0; 
//change the radius to make the point of the squared-hover looks rounded 
    border-radius: 60px; 
1

添加一個類與 '轉盤控制',然後添加以下CSS。 或者您可以將此CSS直接添加到您的代碼

#carousel-example-generic a.carousel-control { 
height: 26%; 
top: 33%; 
width: 86px; 
background: black; 
//add your own CSS as you need 
}