1 回答
TA贡献2051条经验 获得超10个赞
请尝试这个。我已经用 Flex 替换了显示表,以便更好地控制。
meter::-webkit-meter-bar {
height: 25px;
background: none;
background-color: whitesmoke;
box-shadow: 0 5px 5px -5px #333 inset;
margin-bottom: 10px;
}
.scale {
display: flex;
width: 100%;
padding: 0px;
justify-content: space-between;
list-style: none;
}
meter::-webkit-meter-optimum-value {
background-image: -webkit-linear-gradient(/*90deg,
#8bcf69 20%,
#e6d450 20%,
#e6d450 40%,
#f28f68 40%,
#f28f68 60%,
#cf82bf 60%,
#cf82bf 80%,
#719fd1 80%,
#719fd1 100%*/
);
transition: width 1s;
}
<div class="meter-wrapper">
<meter min="1" max="5" value="{{prediction}}"></meter>
<ul class="scale">
<li class=""><span class="scale">1</span></li>
<li><span class="scale">1.8</span></li>
<li><span class="scale">2.6</span></li>
<li><span class="scale">3.4</span></li>
<li><span class="scale">4.2</span></li>
<li class=""><span class="scale">5</span></li>
</ul>
</div>
- 1 回答
- 0 关注
- 106 浏览
添加回答
举报