DEMO
HTML:
<div id="progbar" class="frame">
<span id="min" class="min-max-label ui-widget">200</span>
<span id="progressbar">
<span class="progress-label">Loading...</span>
</span>
<span id="max" class="min-max-label ui-widget">300</span>
</div>
CSS:
#progBar {
text-align: center;
margin:0 auto;
}
#progBar span{
vertical-align: middle;
text-align: center;
display: inline-block;
color: #CC0000;
}
#progressbar {
position:relative;
width: 60%;
height: 36px;
margin: 0 15px;
border-color: #CC0000;
}
.ui-progressbar-value {
position: absolute;
top: 0;
background: #CCCCCC url(http://download.jqueryui.com/themeroller/images/ui-bg_highlight-hard_100_cccccc_1x100.png) 50%;
}
.progress-label{
position: relative;
z-index: 1;
top:4px;
}
你有任何問題,或者它只是問題的優化你的代碼? –
這兩個問題都是「top:4px;」,我不能保留它,因爲如果我更改字體樣式 –
,它將不起作用。另外,左標籤根據瀏覽器呈現不同。 –