由于某些原因,我在 IE 7 和 IE8 中显示背景图像时遇到问题。在 IE9 和更现代的浏览器中,它可以工作并输出以下内容:
(CSS 在登录周围生成灰色边框元素)
然而在 IE7 和 IE8 中我得到的只是以下内容:
我不记得我制作的交叉兼容的其他网站有这个问题,但现在我再次尝试避免使用图像来节省页面加载时间。
我的CSS如下:
#contentright .panel {
background-image: url("/incl/images/bg_panel200.gif");
background-repeat: no-repeat;
}
#contentright .panelbottom {
background-image: url("/incl/images/bg_panelbottom200.gif");
background-position: center top;
background-repeat: no-repeat;
}
我快速进行了 Google 搜索,之前的一些 Stack Overflow 答案建议将 CSS 修改为以下格式:
background: url('/incl/images/bg_panelbottom200.gif') no-repeat center top;
然而这似乎也不起作用。
提前致谢。
尝试使用display:block
为元素并设置width
和height
也使用border:none; background-color:transparent
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)