html - 自定义猫头鹰旋转木马点
问题描述
我想自定义 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;
}
有什么建议么?谢谢
解决方案
我问得太快了。找到了答案。这是任何可能想知道的人的代码
.owl-dots {
text-align: center;
}
.owl-dots button.owl-dot.active span,
.owl-dots button.owl-dot:hover span {
background-color: #FEAE00;
border-radius: 50%;
height: 12px;
width: 12px;
position: absolute;
top: 1px;
left:1px;
}
.owl-dots button.owl-dot{
border: 1px solid gray;
background: white;
border-radius: 50%;
height: 16px;
width: 16px;
position: relative;
}
推荐阅读
- firebase - 如何根据 Kotlin 中属于用户的邮政编码获取订单 Firestore?
- r - PowerBi - R Plotly 没有产生绘图
- r - 表函数如何用于两个向量的组合?
- codeigniter - codeigniter 项目的副本不能在同一台服务器上工作,而是在子域上工作
- mongodb - Spring-data 和 MongoDb 基于子文档属性的聚合和排序
- amazon-athena - 在 athena 上使用 quicksight 是否像普通的 athena 一样每次查询都要花钱?
- javascript - 如何根据对象数组对对象的json数组进行分组
- discord - 在没有公共渠道的情况下写入 Discord 机器人
- webpack - Yarn 努力构建 CSS
- visual-studio - 我为跨平台移动应用程序开发启动了一个新的 Xamarin Forms 项目,并且正在解决问题