2012-05-28 80 views
0

我有以下代碼:我也想在該框的右側添加一個圖像。我會用background-image?有問題的圖片是一個關閉圖標。CSS3背景查詢

CSS:

.scheduledCenter .alertMessage{ 
    width:100%; 
    height:15px; 
    color:#3385B2; 
    background-color:#D1DEE8; 
    border:3px solid #8099B4; 
    border-radius:3px; 
    padding:5px; 
} 

回答

1

您可以添加:

background: #D1DEE8 url('../images/icon.png') no-repeat 100% 0; 

你會得到雙方的圖標和背景顏色。

+0

什麼是100%和0,因爲我需要填充圖像約5px –

+0

100%是水平的起點(你可以指定它在px中)和0垂直起點。 –