如何将自举旋转木马控件定位到最右侧和最左侧?

时间:2015-07-09 11:51:42

标签: css html5 twitter-bootstrap

我有一个图像滑块,我希望左右控制分别位于最右侧和最左侧。它应适用于所有宽度。

可能吗?

4 个答案:

答案 0 :(得分:6)

您可以通过更改carousel-control的宽度来更改其定位。在我看来,4%是伟大的。您可以将其更改为您想要的任何内容。

.carousel-control {
    width: 4%
}

答案 1 :(得分:2)

结帐sample code on Bootstrap's docs后,它看起来像一个非常简单的CSS调整:

.carousel-control.left .glyphicon {
    left: 0;
    margin-left: 0;
}
.carousel-control.right .glyphicon {
    right: 0;
    margin-right: 0;
}

答案 2 :(得分:2)

您可以更新元素样式

.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
  right: 0;  //or you can increase this
}

.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
  left: 0; //or you can increase this
}

答案 3 :(得分:0)

<!--            Left and right controls -->
<a class="left carousel-control" href="mainHomeCarouse" 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="mainHomeCarouse" role="button" data-slide="next"> </a>
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>