我想显示一个进度条,以不同的颜色显示超过100%的百分比,以表明已经超额完成。如何在HTML/CSS中实现这一点?
以下代码可用于显示最多达到100%的百分比进度条:
<div id="progressbar">
<div></div>
</div>
#progressbar {
background-color: black;
border-radius: 13px; /* (height of inner div) / 2 + padding */
padding: 3px;
}
#progressbar div {
background-color: orange;
width: 40%; /* Adjust with JavaScript */
height: 20px;
border-radius: 10px;
}
谢谢!