I’m trying to make a percentage bar for iOS, so I couldn’t use the <input type="range" />, then I’m doing it like this:
<div id="detailedPercentage">
<div id="percLabel">70%</div>
</div>
With this CSS, where perc.png is a 1px colored with rgb(136, 153, 170):
#detailedPercentage {
height: 32px;
width: 286px;
margin-right: 15px;
border: 1px solid #222;
background-image: url(../images/perc.png);
background-color: rgb(242, 242, 242);
background-repeat: repeat;
background-size: 70%;
}
#percLabel {
height: 32px;
width: 100%;
color: #222;
text-align: center;
font-family: Georgia;
line-height: 32px;
font-size: 19px;
background-color: transparent;
}
But the background is filling 100% of the box. What should I do to correct this?
You can use stacked elements to make a progress meter.
HTML – Note the
percDisplayelement.CSS – Note the
positionproperties.http://jsfiddle.net/bxedY/4/