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>
It looks like this:
How should I change the CSS to have three border colors - as on the clock:
- from 0 to 4 color #1
- from 4 to 8 color #2
- from 8 to 12 color #3
I am sure, its possible, with element <canvas>
, but I am not successful with doing that.
You can achieve a circle border divided into 3 sections with an inline svg using:
Here is an example:
Edit
To add text inside the circle, you can use the svg text element:
Try this with css Pseudo-elements three different border colors(same length)