gpt4 book ai didi

css - 连接多个 div/进度条的自定义 CSS 行

转载 作者:行者123 更新时间:2023-11-28 09:32:16 26 4
gpt4 key购买 nike

我想创建将 3 个 div 连接在一起的圆 Angular 线,如下图所示。我尝试使用 css border radius 但不确定如何使它们看起来像下图一样连接。

<div class="progress bar"> 29</div>

<div class="box"></div>

<div class="progress bar"> 28</div>

.box{
width:500px; height:100px;
border:solid 5px #000;
border-color:#000 transparent transparent transparent;
border-radius: 50%/100px 100px 0 0;
}

enter image description here

最佳答案

你可以试试这样的伪元素:

.progress {
position:relative;
margin:50px;
padding:5px;
border:5px solid blue;
width:20px;
border-radius:50%;
text-align:center;
background: #fff;
}
.right:after {
content: " ";
position: absolute;
border-radius: 50%;
top: 15px;
right: -38px;
height: 80px;
width: 80px;
border-right: 5px solid blue;
}
.left:after {
content: " ";
position: absolute;
border-radius: 50%;
top: 15px;
left: -38px;
height: 80px;
width: 80px;
border-left: 5px solid blue;
}
.dotted-left:after {
border-left: 5px dotted blue;
}
.dotted-right:after {
border-right: 5px dotted blue;
}
.dotted-progress {
border-style:dotted;
}
<div class="progress right"> 29</div>
<div class="progress left dotted-left"> 28</div>
<div class="progress dotted-progress"> 28</div>

关于css - 连接多个 div/进度条的自定义 CSS 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46789747/

26 4 0
文章推荐: javascript - 尝试更新发送到 URL 的参数以更改 iframe 的内容
文章推荐: 带有负数和正数的 JavaScript 方程
文章推荐: php - 在isset($_GET ['post_id' ]) === true)之后,需要调用Javascript将
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com