当前位置:Gxlcms > html代码 > 问个表格的问题_html/css_WEB-ITnose

问个表格的问题_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:25人阅读

我在其中一个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'})}


实体营业厅
3
查看详情

想问下,如何能让鼠标在这一行上面时,这一行所有的td背景色都变。谢谢解答。


回复讨论(解决方案)

我觉得其实已经变色了,被图片挡着,你看不出来了

没有 ,我试过直接把背景色 改成绿色,能看到绿色,背景图片并没有填满整个td,所以背景色变了能看到,我用的IE9

把background的属性分开设置就好了。
background-image:url("images/xp.png");
background-repeat:no-repeat;
background-position:center;

人气教程排行