一般来说,设置input按钮的background-image属性,在Firefox,Chrome等标准W3C浏览器中,只要写二行css:
background-image: url(images/hello.jpg); background-repeat: no-repeat;
但是在IE下,只写上面二行CSS,input元素是不会显示背景图片的,需要写成如下形式,才能正常显示:
background-image: url(images/hello.jpg); background-repeat: no-repeat; background-color: transparent; border:none;
其实关键是background-color: transparent,让背景色透明,才能在IE下显示背景图片
Comments on this entry are closed.