I am trying to achieve UI as shown in the image. However I am having little hard time after trying combinations of positioning now I am clueless. Can someone help me with this?
<style>
.progress{
position:relative;
width:500px;
}
.bar{
}
.percent{
}
</style>
<div class="progress">
<span class="bar" width="%"></span>
<span class="percent">50%</span>
</div>
i had the same problem and developed this:
http://jsfiddle.net/DgXM6/2/
HTML:
CSS:
In the following sample I added to non breaking spaces to achieve that the browser gives your box a dimension. Without that it would assume it empty and thus not applying the correct width and height.
You also might want to give the boxes a position:absolute, for putting them on top of each other. You also should use the style attribute instead of the width attribute since there is no width attribute for divs.
interactive demo at http://jsfiddle.net/gaby/Zfzva/