2010-08-30 59 views
1

我正在製作一個進度條來顯示捐贈目標的進度。我的圖像形狀像溫度計,底部圓潤。使用CSS來顯示圖像的可變部分

這裏是我使用的顯示欄

<div style="width: 179px; height: <%: 484 * Model.PercentToGoal %>px; background-image: url(../Content/Images/meter_fill.png); color: inherit; position: absolute; left:113px; bottom: 60px;"> 
    </div> 

我遇到的問題是它似乎首先顯示圖像的上半部分的代碼。我如何開始從圖像的底部顯示?

回答

0
<div style="width: 179px; height: <%: 484 * Model.PercentToGoal %>px; background-image: url(../Content/Images/meter_fill.png) bottom; color: inherit; position: absolute; left:113px; bottom: 60px;"> 
    </div> 

- > CSS:背景位置:底部或如上面

代碼中的短方式