gpt4 book ai didi

html - 在 CSS 之前使用,在背景中添加圆圈

转载 作者:可可西里 更新时间:2023-11-01 13:21:55 29 4
gpt4 key购买 nike

我想在导航按钮后面加一个圆圈。但我无法实现它。我正在使用 Swiper。

这些是我将圆定位在导航箭头下方时的一些快照。

enter image description here enter image description here enter image description here

如您所见,当我调整::before 的 margin-left 时,背景圆圈位于导航按钮上方。我正在使用 pseudo::before css 来创建圆圈。但我无法实现它。这是我的 CSS 作品。请检查一下,让我知道我哪里做错了?

.content .swiper-button-next {
height: 25px;
padding-left: 62px;
padding-top: 0px;
margin-top: -13px;
z-index: 4 !important;
position: absolute;
}

.swiper-button-next.swiper-button-white{
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%…2L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E");
right: 10px;
left: auto;
}

.swiper-button-next, .swiper-button-prev {
top: 50%;
width: 27px;
cursor: pointer;
background-size: 27px 44px;
background-position: center;
background-repeat: no-repeat;
}


.content .swiper-button-next:before {
content: '';
display: inline-block;
width: 50px;
height: 50px;
-moz-border-radius: 50%;
border-radius: 50%;
margin-left: -53px;
margin-top: -11px;
opacity: 0.7;
z-index: -2;
position: relative;
background: #080808;
}
<div class="content swiper-container-horizontal swiper-container-free-mode">
<div class="swiper-button-next swiper-button-white"></div>
</div>

提前谢谢你。

最佳答案

.swiper-button-next:before {
content: '';
display: inline-block;
width: 50px;
height: 50px;
-moz-border-radius: 50%;
border-radius: 50%;
background-color: #060606;
margin-left: -53px;
margin-top: -11px;
opacity: 0.8;
z-index: -2;
position: relative;
}

.swiper-button-next {
height: 25px;
padding-left: 62px;
padding-top: 0px;
margin-top: -13px;
z-index: 4 !important;
position: absolute;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%…2L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E");
right: 10px;
left: auto;
top: 50%;
width: 27px;
cursor: pointer;
background-size: 27px 44px;
background-position: center;
background-repeat: no-repeat;
}
.arrow{ width: auto;
display: inline-block;
position: absolute;
z-index: 9999;
left: 31px;
vertical-align: middle;
color: #ffffff;
opacity: 0.3;
font-size:20px;
}
<div class="swiper-button-next swiper-button-white"><div class="arrow">❯<div></div>

关于html - 在 CSS 之前使用,在背景中添加圆圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45731316/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com