2012-04-16 64 views
1

我想在CSS來支持三種背景圖片內嵌顯示多個內嵌容器與背景圖像,但沒有內容

<div id="hd_but2"></div> 
<div id="hd_div1"></div> 
<div id="hd_but1"></div> 

#hd_but2 { 
background-image:url('1.png'); 
background-repeat:no-repeat; 
height:28px; 
width:49px; 
margin-top:9px; 
} 
#hd_div1 { 
background-image:url('2.png'); 
background-repeat:no-repeat; 
height:46px; 
width:4px; 
} 
#hd_but1 { 
background-image:url('3.png'); 
background-repeat:no-repeat; 
height:28px; 
width:29px; 
margin-top:9px; 
} 

但每次我改變內聯的div它需要的內容,像文本一樣,以顯示背景圖像...我怎麼可以做到這一點,而不需要將文本放入容器中......最好的方法是做什麼?

回答

0

您是否嘗試過使用display: inline-block