<!doctype>
<title></title>
<meta charset= "Utf-8" >
<style>
. Circle {
width:200px;
height:200px;
Position:absolute;
border-radius:50%;
background:red;
}
. Pie_left,. pie_right {
width:200px;
height:200px;
Position:absolute;
top:0;left:0;
}
. Left,. Right {
Display:block;
width:200px;
height:200px;
Background: #00aacc;
border-radius:50%;
Position:absolute;
top:0;
left:0;
}
. Pie_right,. Right {
Clip:rect (0,auto,auto,100px);
}
. Pie_left,. Left {
Clip:rect (0,100px,auto,0);
}
. Mask {
width:160px;
height:160px;
border-radius:50%;
left:20px;
top:20px;
Background: #FFF;
Position:absolute;
Text-align:center;
line-height:150px;
font-size:16px;
}
</style>
<script src= "Js/jquery.js" ></script>
<script>
$ (function () {
$ ('. Circle '). each (function (index, EL) {
var num = $ (this). Find (' span '). Text () * 3.6;
if (num<=180) {
$ (this). Find ('. Right '). CSS (' transform ', "rotate (" + num + "deg)");
} else {
$ (this). Find ('. Right '). CSS (' transform ', "Rotate (180deg)");
$ (this). Find ('. Left '). CSS (' transform ', "rotate (" + (num-180) + "deg)");
};
});
});
</script>
<body>
<div class= "Circle" >
<div class= "Pie_left" >
<div class= "left" ></div>
</div>
<div class= "Pie_right" >
<div class= "right" ></div>
</div>
<div class= "Mask" >
<span>10</span>%
</div>
</div>
</body>
HTML Ring (the code is not original, the specific source is unknown)