CSS 实现圆形弧度分割:五段不同颜色弧线
<!DOCTYPE html>
<html>
<head>
<style>
.arc {
width: 200px;
height: 200px;
border-radius: 50%;
position: relative;
overflow: hidden;
}
<pre><code>.arc::before {
content: '';
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
border: 5px solid transparent;
border-top-color: red;
transform: rotate(72deg);
}
.arc::after {
content: '';
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
border: 5px solid transparent;
border-top-color: orange;
transform: rotate(144deg);
}
.arc div {
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
border: 5px solid transparent;
border-top-color: yellow;
transform: rotate(216deg);
}
.arc span {
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
border: 5px solid transparent;
border-top-color: green;
transform: rotate(288deg);
}
.arc p {
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
border: 5px solid transparent;
border-top-color: blue;
transform: rotate(360deg);
}
</code></pre>
</style>
</head>
<body>
<div class='arc'>
<div></div>
<span></span>
<p></p>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/piCC 著作权归作者所有。请勿转载和采集!