2014-07-23 136 views
0
a href="https://play.google.com/store/apps/details?id=appinventor.ai_fleimlehner.Drafinity&hl=en"> 
    <img alt="Get it on Google Play" src="/images/brand/en_generic_rgb_wo_60.png" /> 
</a> 

這是代碼我不知道什麼是錯的,因爲我從Google Play上的徽章生成器中複製並粘貼了該代碼。徽章沒有顯示,但鏈接正在工作。我的Google play徽章沒有顯示在我的網站上

+2

我想'_ images/brand/en_generic_rgb_wo_60.png'根本不存在於_your_服務器上。 – Zeta

+1

Google服務沒有任何問題,PNG不可能存在於您的服務器上** – BenM

回答

1

您的鏈接將工作,無論什麼輸入爲可點擊例如:

<a href="https://play.google.com/store/apps/details?id=appinventor.ai_fleimlehner.Drafinity&hl=en"> 
    wibble 
</a> 

的圖像元素(<img alt="Get it on Google Play" src="/images/brand/en_generic_rgb_wo_60.png" />)將無法正常工作,除非你images文件夾中,在brand子文件夾你有一個圖像名稱「en_generic_rgb_wo_60.png

如果您想要更好的解釋,您應該查看相對路徑和絕對路徑。 IMG標籤上的following link是一個非常有趣和詳細的artile。

什麼,你也可以做的是圖像URL添加到外部網站(雖然知道有些網站防止這種情況),例如:

<img alt="Get it on Google Play" src="http://cdn1.tnwcdn.com/files/2010/09/1-500x354.gif" /> 

道歉,如果圖像停止上述工作,但你應該得到你需要做什麼的一般想法。找到圖片的URL並使用它來代替路由字符串。

相關問題