gpt4 book ai didi

html - 如何为 IE 8 添加 CSS 背景图片?

转载 作者:行者123 更新时间:2023-11-28 09:24:59 26 4
gpt4 key购买 nike

我已经为 div 编写了 CSS 添加背景图像,该图像在 FF、CH 上可见,...但是,它在 IE 8 上不显示

CSS文件

#headerrotetor{
width: 100%;
max-width: 1600px;
max-height: 660px;
background-image: url(images/hm_bg.jpg);
background-repeat: no-repeat;
margin: 0 auto;
background-size:contain;
}

而且我已经为 IE 维护了文件中的 CSS

#headerrotetor{
height: 660px;
width: 1600px;
}

背景图片大小340Kb,谁能帮帮我,谢谢

最佳答案

您使用的路径是否正确?

尝试将背景应用到 body 标签。下面的代码支持 IE 4.0 以上版本。

body {
background-image: url('paper.gif');
background-repeat: no-repeat;
background-position: right top;
}

注意:IE8 及更早版本不支持一个元素上的多个背景图像。

关于html - 如何为 IE 8 添加 CSS 背景图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25926018/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com