简体   繁体   English

Firefox中没有显示背景图像

[英]Background-image is not displaying in Firefox

Strange thing happens. 奇怪的事情发生了。 Background-image is not displaying in Firefox under some versions of WindowsXP and Windows Vista, but displays in Firefox under Mac OSX. 在某些版本的WindowsXP和Windows Vista下,Firefox中不显示背景图像,而是在Mac OSX下的Firefox中显示。 It also displays in IE. 它也显示在IE中。 This is CSS: 这是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;
}

And this is html: 这是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>

You can see on http://www.inveda.ru - right column - red banner. 你可以在http://www.inveda.ru看到 - 右栏 - 红色横幅。

Your code is valid and yes, I can see the background correctly. 您的代码是有效的,是的,我可以正确地看到背景。 (FF, IE6-9, Safari, Opera, Chrome) (FF,IE6-9,Safari,Opera,Chrome)

I believe this is a browser caching problem (old CSS remaining on your XP machine). 我相信这是一个浏览器缓存问题(你的XP机器上剩下的旧CSS)。 Make sure you hit Ctrl+F5 when you want to preview your page on different browser / PC. 如果要在不同的浏览器/ PC上预览页面,请确保按Ctrl + F5。

尝试将颜色设置为trasnsparent并删除url中的引号:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM