gpt4 book ai didi

html - 如何用CSS3制作弧形?

转载 作者:行者123 更新时间:2023-11-28 03:48:38 25 4
gpt4 key购买 nike

我正在尝试使用纯 CSS 实现以下外观:

enter image description here

其中每个白色弧线都是不同的元素,例如跨度。我知道我们可以用 css 制作圆形,但如何将其变成弧形?

最佳答案

使用以下 HTML:

<div id="arcs">
<div>
<div>
<div>
<div></div>
</div>
</div>
</div>
</div>

还有 CSS:

#arcs div {
border: 2px solid #000; /* the 'strokes' of the arc */
display: inline-block;
min-width: 4em; /* the width of the innermost element */
min-height: 4em; /* the height of the innermost element */
padding: 0.5em; /* the spacing between each arc */
border-radius: 50%; /* for making the elements 'round' */
border-top-color: transparent; /* hiding the top border */
border-bottom-color: transparent;
}

#arcs div {
border: 2px solid #000;
/* the 'strokes' of the arc */
display: inline-block;
min-width: 4em;
/* the width of the innermost element */
min-height: 4em;
/* the height of the innermost element */
padding: 0.5em;
/* the spacing between each arc */
border-radius: 50%;
/* for making the elements 'round' */
border-top-color: transparent;
/* hiding the top border */
border-bottom-color: transparent;
}
<div id="arcs">
<div>
<div>
<div>
<div></div>
</div>
</div>
</div>
</div>

JS Fiddle demo .

关于html - 如何用CSS3制作弧形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43840233/

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