2011-11-18 48 views
1

我有一個表格單元,在那個單元格中我想在2個不同的位置顯示2個不同的背景圖像。我使用在IE中使用CSS顯示兩個背景圖像6

<table border="0" cellspacing="0" cellpadding="0" width="100" height="100"> 
<tr> 
    <td id="arrow" class="top">&nbsp;</td> 
</tr> 
<tr> 
    <td id="arrow" class="mid">&nbsp;</td> 
</tr> 
<tr> 
<td id="arrow" class="bottom">&nbsp;</td> 
</tr> 
</table> 

的CSS是:

td#arrow.top{ 
    background-image: url('images/pic1.jpg'), url('images/pic2.jpg'); 
    background-position: left top, center center; 
} 

如何顯示使用CSS 2個獨立的背景圖像,使得它們在IE中顯示6.

+1

IE6和花哨的CSS,urgh ... – Ben

+0

有一個簡單的辦法有2個背景圖片在IE 6? – user1212

回答

1

你不能有2張背景圖片在一個元素上。您需要在單元格中創建另一個元素(可以是相同尺寸的電池本身),並設置在每一個背景:

<td> 
    <div class="td-container"> 
    </div> 
</td> 

td { 
    background: url(/img/bg1.jpg) left top no-repeat; 
} 
.td-container { 
    background: url(/img/bg2.jpg) right bottom no-repeat; 
} 

另外,您可以創建一個圖像,其在需要的結合了圖像並將其作爲背景。

0

您需要使用div來分隔圖像。這是可以做到的嘗試像

<td><div class="top"></div></td> 

那麼你的CSS將有

​​