【问题标题】:IE 9 background image position attributeIE 9 背景图片位置属性
【发布时间】:2015-03-31 22:04:34
【问题描述】:

我是 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>

【问题讨论】:

  • 我添加了 top:0;左:0;但没用
  • 您可以为您的代码创建一个jsfiddle 吗?

标签: html css internet-explorer internet-explorer-9


【解决方案1】:

试试这个:

<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。

【讨论】:

    猜你喜欢
    • 2013-11-04
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    • 2015-01-04
    • 1970-01-01
    • 1970-01-01
    • 2011-05-12
    • 2021-04-11
    相关资源
    最近更新 更多