2012-06-13 48 views
1

我正在做一些最終的測試,在我的網站上線之前。我已經在Chrome中構建了它,並且我發現了在IE中可以使用的所有功能!CSS在IE中沒有顯示(任何版本)

我有我構建了一個不是在IE呈現出精靈......

HTML

<a href="https://plus.google.com/111035429397283398622/" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social plus1" alt="Join our Circles on Google+" /></a> 

<a href="http://www.facebook.com/primorisfinancial" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social facebook" alt="Like Primoris Financial on Facebook" /></a> 

<a href="http://au.linkedin.com/in/benjaminirons" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social linkedin" alt="Benjamin Irons on LinkedIn" /></a> 

<a href="http://primorisfinancial.blogspot.com" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social blogger" alt="Primoris Financial on Blogger" /></a> 

<a href="http://twitter.com/PrimorisFinPlan" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social twitter" alt="Follow Primoris Financial on Twitter" /></a> 

<a href="http://www.youtube.com/PrimorisFinancial" target="_blank"><img src="http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/spacer.gif" class="sprite social youtube" alt="Primoris Financial on YouTube" /></a> 

與下面的CSS

.sprite {background:url(http://127.0.0.1:600/wordpress/wp-content/uploads/2012/06/Social-CSS-Sprite-Test.png);} 
    .social {height:32px;} 

/* Social Buttons */ 

     .plus1 {width:32px; background-position:0px 0px;} 
     .facebook {width:32px; background-position:-33px 0px;} 
     .linkedin {width:32px; background-position:-66px 0px;} 
     .blogger {width:32px; background-position:-99px 0px;} 
     .twitter {width:32px; background-position:-132px 0px;} 
     .youtube {width:32px; background-position:-165px 0px 

;}

+2

您無法使用指向本地主機的URL。 –

+0

他還沒有活,所以這不是問題 –

+0

你知道什麼版本的IE嗎? – Dips

回答

0

刪除從你的圖像src(更好地使用跨度比img)。

修復你的CSS中的URL是相對的,而不是指向127.0.0.1(本地主機)。

檢查您是否具有正確的HTML頭:

<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
+0

不要忘記讓所有的html有效! –

1

一個主要的問題,據我可以看到的是,你要鏈接到你的CSS的圖像,而無需使用帶/語音標記。而作爲dystroy說,不要硬鏈接的圖像,這是最好的做比較是這樣的:

{background:url('../wp-content/uploads/2012/06/Social-CSS-Sprite-Test.png');} 

這應該可以解決您的問題。