我正在使用 Bootstrap 4 Beta 2 版本来做轮播。代码如下所示:
<ol class="carousel-indicators">
<li data-target="#mycarousel" data-slide-to="0" class="active"></li>
<li data-target="#mycarousel" data-slide-to="1" ></li>
<li data-target="#mycarousel" data-slide-to="2" ></li>
</ol>
And the carousel indicator show as lines:
有没有办法可以将指示器更改为点而不是线?我认为它是一个引导选项,但我没有找到相关文档。我需要为此编写自定义CSS吗?
是的,我认为你需要编写自定义 CSS 来将线变成点。
您只需要覆盖两个属性(width
and height
)并添加一个新的,border-radius
, to .carousel-indicators li
.
Make width
and height
值相等,例如:10px
每个并给出一个border-radius
of 100%
.
.carousel-indicators li {
width: 10px;
height: 10px;
border-radius: 100%;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)