【问题标题】:Background-image is not displaying in Firefox背景图像未在 Firefox 中显示
【发布时间】:2010-06-17 22:50:28
【问题描述】:

奇怪的事情发生了。在某些版本的 WindowsXP 和 Windows Vista 下的 Firefox 中不显示背景图像,但在 Mac OSX 下的 Firefox 中显示。它也显示在 IE 中。 这是 CSS:

.cherry_banner {
background: url("library/media/images/cherry_banner_top.png") no-repeat;
width: 276px;
display:block;
min-height:100px;
padding-top: 13px;
color: #fdfdfd;
margin-bottom:20px;
}

.cherry_banner a {
color: #fdfdfd;
}

.cherry_banner a:hover {
text-decoration:underline;
}

.cherry_banner li {
list-style-type:none;
}

.cherry_banner h2 {
font-size: 18px;
margin-bottom: 10px;
}

.chb_text1 {
background: url("library/media/images/cherry_banner_pixel.png") repeat-y;
}

.chb_text2 {
background: url("library/media/images/cherry_banner_bottom.gif") bottom no-repeat;
padding: 4px 14px 24px 25px;
}

这是html:

<div id="linkcat-8" class="cherry_banner tpt"><div class="chb_text1"><div class="chb_text2">
<h2>Для москвичей</h2>
<ul class='xoxo blogroll'>
<li><a href="http://inveda.ru/jyotish/naksatra-calendar/">Закажите бесплатный индивидуальный календарь благоприятных дат на 2010г.</a></li>
</ul>
</div></div></div>

您可以在http://www.inveda.ru 上看到 - 右栏 - 红色横幅。

【问题讨论】:

  • 红色横幅在 Mac OS Snow Leopard 的 Safari 5 和 Opera 10.50 中都可以。
  • 您在 Windows XP 和 Vista 中测试了哪个版本的 Firefox?

标签: html css firefox


【解决方案1】:

您的代码是有效的,是的,我可以正确看到背景。 (FF、IE6-9、Safari、Opera、Chrome)

我认为这是浏览器缓存问题(旧 CSS 保留在您的 XP 机器上)。当您想在不同的浏览器/PC 上预览您的页面时,请确保您按 Ctrl+F5。

【讨论】:

  • 我正在为 Windows XP 启动一个虚拟机来确认您所说的。 ;)
【解决方案2】:

尝试将颜色设置为透明并删除网址中的引号:

background: transparent url(library/media/images/cherry_banner_top.png) no-repeat;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-27
    • 1970-01-01
    • 2020-02-05
    • 2019-02-11
    • 2019-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多