Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have this CSS for a circle with one border color:

.circle {
  border: 6px solid #ffd511;
  border-radius: 30px;
  -moz-border-radius: 30px;
  -webkit-border-radius: 30px;
  -khtml-border-radius: 30px;
  width: 30px;
  height: 18px;
  line-height: 20px;
  padding: 12px 6px;
  text-align: center;
}
<div class="circle">17</div>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
939 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can achieve a circle border divided into 3 sections with an inline svg using:

Here is an example:

svg{width:30%;height:auto;}
<svg viewbox="0 0 10 10">
  <defs>
    <circle id="circle" cx="5" cy="5" r="4" stroke-width="0.5" fill="transparent" />
  </defs>
  <use xlink:href="#circle" stroke="pink" stroke-dasharray="0,2.09,8.38,30" />
  <use xlink:href="#circle" stroke="green" stroke-dasharray="0,10.47,8.38,30" />
  <use xlink:href="#circle" stroke="orange" stroke-dasharray="2.09,16.75,6.3" />
</svg>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...