大家好!
我想在CSS中创建一个小的圆形静态指示器,但我找不到解决方案。 左边的方形指示器没问题,但如此狡猾,我想要它!
我试着用圆角(比较屏幕右侧的指标),我想知道是否有可能添加一个圆角掩码来隐藏角点(参见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;
}
你是什么意思的圆进度指标?通常情况下,进展是线性的,然后到达最后,这样就可以使自己成为一条线。 – rjmunro 2009-11-19 20:02:26