日期:2014-05-16  浏览次数:20591 次

问个表格的问题
我在其中一个td中插入了一个图片,我原来是鼠标在这一行上面时,都变绿,现在鼠标在这一行上面时,添加背景图片这个td背景色不变。
.spectd{
background:url("images/xp.png") no-repeat center;
}
.spectr{event:expression(onmouseover=function(){this.style.background='green';},onmouseout=function(){this.style.backgroundColor='white'})}

<tr class="spectr">
 <td style="width:120px;height:40px;">实体营业厅</td>
 <td style="width:50px;height:40px;">3</td>
 <td class="spectd" onclick="alert(1)">查看详情</td>
 </tr>
想问下,如何能让鼠标在这一行上面时,这一行所有的td背景色都变。谢谢解答。

------解决方案--------------------
我觉得其实已经变色了,被图片挡着,你看不出来了
------解决方案--------------------
把background的属性分开设置就好了。
background-image:url("images/xp.png");
background-repeat:no-repeat;
background-position:center;