2010-06-17 123 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