一般来说,设置input按钮的background-image属性,在Firefox,Chrome等标准W3C浏览器中,只要写二行css:

1
2
background-image: url(images/hello.jpg);
background-repeat: no-repeat;

但是在IE下,只写上面二行CSS,input元素是不会显示背景图片的,需要写成如下形式,才能正常显示:

1
2
3
4
background-image: url(images/hello.jpg);
background-repeat: no-repeat;
background-color: transparent;
border:none;

其实关键是background-color: transparent,让背景色透明,才能在IE下显示背景图片

相关文章:

  • 2022-12-23
  • 2021-10-23
  • 2021-07-04
  • 2022-12-23
  • 2021-06-12
  • 2021-06-21
  • 2021-10-05
  • 2022-03-01
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案