【问题标题】:Background-image problem in IE 7IE 7 中的背景图像问题
【发布时间】:2013-05-27 23:22:32
【问题描述】:

我有 CSS 类的锚元素。 所有浏览器都能很好地显示 BG 图像,除了 IE 7(它根本不会显示图像)。 (我添加了 _attributes ,因为我看到了其他站点中使用的那个)。 在 IE7 中使用 IE Developer 工具时,它会显示 background-image: none... 谢谢

color: #FFFFFF;
cursor: pointer;
height: 102px;
left: 0;
margin-left: -7px;    
position: fixed;
text-indent: -9999px;
top: 25%;
width: 35px;
z-index: 9998;
background-color: #279cff;
border-color: #279cff;
border-style: outset outset outset none;
border-width: 1px 1px 1px medium;
background-repeat: no-repeat;
height:170px;     
background-image: url(../images/1.png);     
background-position: 11px;

【问题讨论】:

  • 你的意思是png文件的不透明度吗?
  • :) - 我希望...无论如何 IE7 也无法工作
  • @Sanja - 图片根本不会显示
  • @Jason:我完全同意!!!连 MS 都不支持了!!
  • 如果所有开发者都拒绝支持IE6,也许我们都可以过上幸福的生活:)

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


【解决方案1】:

如果背景具有 alpha 透明度,您将无法在 IE6 中正确看到它,因为它不能很好地呈现 PNG。切换到 gif 或停止支持 ie6 :P

【讨论】:

  • 那不是我的问题。它根本不会显示。我编辑了我的问题
  • 它发生在 IE7 中......这是我主要关心的问题
  • 尝试背景:url(../images/1.png) no-repeat;
  • 另外,如果您不使用严格模式,您的固定位置也可能是 IE7 的问题
  • 表示ie7支持position:fixed但必须是严格模式(在doctype中)
【解决方案2】:

下划线是 CSS 属性只能在 6 上工作的 hack,不要使用它,而是为 IE 使用不同的 CSS。 IE6 不能很好地处理 png。尝试使用jpg,它可能会工作。 如果没有,尝试浮动或显示:阻塞元素,看是否显示背景。

【讨论】:

  • 我看到你编辑了你的问题,尝试使用:background-image:url("../images/1.png");并将背景重复放在背景图像下方。
【解决方案3】:

如果您以_property 开头,则用于IE6 hacking。它只适用于 IE6。对于 IE6 使用 _property 对于 IE7 使用 #property

【讨论】:

  • 那不是我的问题。它根本不会显示。我编辑了我的问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-09
  • 1970-01-01
  • 1970-01-01
  • 2011-10-08
  • 2011-07-15
  • 1970-01-01
相关资源
最近更新 更多