首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

this.background的兼容性有关问题

2012-03-12 
this.background的兼容性问题onmouseoverthis.backgroundimages/menubgred.jpg onmouseoutthis.ba

this.background的兼容性问题
onmouseover="this.background='images/menubgred.jpg'" onmouseout="this.background=''"在IE下面是正常的,但是换了不是IE内核的浏览器就不正常了,肯定是兼容性的问题,应该怎么写才能通用呢??求解

[解决办法]

onmouseover="this.style.backgroundImage='url(images/menubgred.jpg)'" onmouseout="this.style.backgroundImage=''"
我去试了一下,要这样写才行

热点排行