【发布时间】:2010-12-18 11:24:32
【问题描述】:
大家好!
我想在 CSS 中创建一个小的圆形静态 pourcent 指示器,但我找不到解决方案。 左边的平方指标还可以,但是太丑了,我要圆!
我尝试过圆角(cf 屏幕截图右侧的指示符),我想知道是否有可能添加圆角蒙版来隐藏角(cf.css3 蒙版:http://webkit.org/blog/181/css-masks/),但似乎好像它只适用于 img...
该解决方案仅适用于 webkit 浏览器,因为它适用于移动 webapp。
这是我在上图中创建(丑陋的)指标的代码:
<div class="meter-wrap">
<div class="meter-value" style="background-color: #489d41; width: 70%;">
<div class="meter-text"> 70 % </div>
</div>
</div>
还有CSS:
.meter-wrap{
position: relative;
}
.meter-value {
background-color: #489d41;
}
.meter-wrap, .meter-value, .meter-text {
width: 30px; height: 30px;
/* Attempt to round the corner : (indicators at the right of the screenshot)
-webkit-border-radius : 15px;*/
}
.meter-wrap, .meter-value {
background: #bdbdbd top left no-repeat;
}
.meter-text {
position: absolute;
top:0; left:0;
padding-top: 2px;
color: #000;
text-align: center;
width: 100%;
font-size: 40%;
text-shadow: #fffeff 1px 1px 0;
}
【问题讨论】:
-
圆形进度指示器到底是什么意思?通常,进度是线性的,然后到达终点,这样就可以排成一行。
标签: html safari css mobile-safari