2017-09-16 84 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 
}