2010-06-17 124 views
3

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

.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 - 右边一栏 - 红色横幅。

+0

对于Mac OS Snow Leopard,红色横幅在Safari 5和Opera 10.50中都可以使用。 – Alerty 2010-06-17 14:43:59

+0

在Windows XP和Vista中测试了哪个版本的Firefox? – Alerty 2010-06-17 14:48:40

回答

0

尝试也设置颜色网址trasnsparent和删除报价:

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

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

我相信这是一个浏览器缓存问题(旧的CSS剩余在你的XP机器上)。当你想在不同的浏览器/ PC上预览你的页面时,确保你点击了Ctrl + F5。

+0

我正在启动Windows XP的虚拟机来确认你在说什么。 ;) – Alerty 2010-06-17 14:50:58

+0

我确认它可以在Windows XP下运行! – Alerty 2010-06-17 15:03:28