我在其中一个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'})}
我觉得其实已经变色了,被图片挡着,你看不出来了
没有 ,我试过直接把背景色 改成绿色,能看到绿色,背景图片并没有填满整个td,所以背景色变了能看到,我用的IE9
把background的属性分开设置就好了。
background-image:url("images/xp.png");
background-repeat:no-repeat;
background-position:center;
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号