1

在 CMS 中使用一些内联 CSS(有趣!)。这段代码在 Chrome 和 Firefox 中正常工作,背景图像只出现一次。但是当页面在 IE 9 中加载时,就好像 no-repeat 值被忽略并且背景图像在 div 的长度上重复。

<div style="width: 500px; margin-top: -10px; background-image: url(http://.../uploadedImages/horizontal-rule-top.gif); background-position: 50% 0%; background-repeat: no-repeat, no-repeat; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(228, 128, 28); padding-top: 30px; padding-bottom: 15px; font-size: 16px; ">
...</div>

任何建议将不胜感激!

4

4 回答 4

5

我认为 IE 在存在 second 时遇到了麻烦no-repeat,并且根据规范,无视它不理解的规则。IE 理解的选项似乎是:

  • repeat-x,
  • repeat-y, 和
  • no-repeat.

如果您将 CSS 修改为上述之一,它应该可以工作。

于 2012-04-09T19:57:09.040 回答
0

尝试background-repeat: no-repeat;不使用第二个值。我相信二值语法是CSS3 工作草案的一部分, IE9 可能无法实现。

于 2012-04-09T19:59:36.780 回答
0

试试你的背景 css “背景:url(http://.../uploadedImages/horizo​​ntal-rule-top.gif) no-repeat 50% 0%;”

于 2012-05-16T10:19:46.943 回答
0

证明:

背景-重复-x:不重复;背景重复:重复-y;

于 2014-12-04T14:21:45.500 回答