我是 CSS 的新手,试图通过以下代码显示图像,它在 Chrome 和 FireFox 中有效,但在 IE 9 中无效。当我删除位置属性时,它在 IE9 中显示图像。感谢您的帮助!
<div style="background:url(/templates/intranet/images/car.png); background-position:50%; background-size:auto 70%; background-repeat:no-repeat;width:100%; height:100%;position:absolute;"></div>
最佳答案
试试这个:
<div style="background:url(/templates/intranet/images/car.png); background-position:50% 50%; background-size:auto 70%; background-repeat:no-repeat;width:100%; height:100%;position:absolute;"></div>
您必须添加“背景位置:50% 50%;”编写正确的 CSS。
关于html - IE 9背景图片位置属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29370275/