I have made a color wheel, and it is looking good except for the last element which is occupying more space and it has a larger width
. How can I make it so all my span's
share an equal width
demo
@for $i from 1 through 25 {
span:nth-child(#{$i}) {
border-top-color: hsl($i * 15, 50%, 50%);
border-left-color: transparent;
border-right-color: transparent;
border-bottom-color: transparent;
}
}
@for $i from 1 through 25 {
span:nth-child(#{$i}) {
transform: rotate($i * 14.4deg);
}
}
#colorWheel {
-webkit-animation: intro 3s ease;
width: 100px;
height: 100px;
margin: 0 auto;
position: relative;
transform-origin: 50px 150px;
transition: all 0.5s linear;
}
#colorWheel::before {
content: "";
width: 300px;
height: 300px;
overflow: hidden;
position: absolute;
top: -30px;
left: -130px;
border-radius: 100%;
border: 30px solid #ffffff;
z-index: 100;
}
#colorWheel span {
position: absolute;
-webkit-transform-origin: 50% 50%;
border-style: solid;
border-width: 150px 50px;
box-sizing: border-box;
}
<div id="colorWheel">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span> <!-- 25 span's -->
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…