【发布时间】:2021-07-18 09:55:01
【问题描述】:
我想自定义 Owl Carousel 圆点。不活动时,它只是一个带有灰色边框和白色背景的圆圈。当我悬停或活动时,我想要那个圆圈内的黄点。我尝试使用一些 css 来做到这一点,但我没有得到任何结果。
我的代码
<div class="owl-carousel owl-theme">
<div class="item">
<h4><img src="https://via.placeholder.com/150"></h4>
</div>
<div class="item">
<h4><img src="https://via.placeholder.com/150"></h4>
</div>
<div class="item">
<h4><img src="https://via.placeholder.com/150"></h4>
</div>
<div class="item">
<h4><img src="https://via.placeholder.com/150"></h4>
</div>
</div>
<div class="owl-dots">
<button role="button" class="owl-dot active"><span></span></button>
<button role="button" class="owl-dot"><span></span></button>
<button role="button" class="owl-dot"><span></span></button>
<button role="button" class="owl-dot"><span></span></button>
</div>
CSS:
.owl-dots button.owl-dot.active span,
.owl-dots button.owl-dot:hover span {
background-color: yellow;
border-radius: 50%;
height: 16px;
width: 16px;
}
.owl-dots button.owl-dot{
border: 1px solid gray;
background: white;
border-radius: 50%;
height: 19px;
width: 19px;
position: relative;
}
有什么建议吗?谢谢
【问题讨论】:
标签: html css owl-carousel