2015-04-07 122 views
0

我想爲我的代碼創建一個鏈接,以便人們可以單擊它,但每當我將代碼上傳到我的文件時,我都無法點擊它。有人可以幫忙嗎?這裏是我的代碼:爲什麼我無法爲我的HTML代碼製作可點擊的鏈接?

<!DOCTYPE html> 

<html> 
<head> 
<style> 
img.transp { 
    opacity: 0.4; 
    filter: alpha(opacity=40); 
} 
</style> 
<link rel="icon" href="favicon.ico" type="image/x-icon"/> 
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> 
<title> 
Home - Stampycraft.net 
</title> 
</head> 
<body> 
<center> 
<h1> 
<a href="http://facebook.com"><img src="gaoosh.gif" /></a> 

</h1> 
</center> 
<div style='position:absolute;z-index:0;left:0;top:0;width:100%;height:100%'> 
    <img class="transp" src=stampy6.png style='width:100%;height:100%' alt='[]' /> 
</div> 

</body> 
</html> 

回答

1

這是覆蓋它:

<div style='position:absolute;z-index:0;left:0;top:0;width:100%;height:100%'> 
    <img class="transp" src=stampy6.png style='width:100%;height:100%' alt='[]' /> 
</div> 

刪除代碼,你會明白我的意思。

一種替代方案:

<div style='position:absolute;left:0;top:0;'> 
    <img class="transp" src=stampy6.png alt='[]' /> 
</div> 
+0

有沒有保留這段代碼並且建立鏈接?或者是否有完全不同的代碼?謝謝回答 – montocore

+0

不,你可以用不同的方式來解決問題。是stampy6.png你的標誌?你可以將它設置爲頁面背景,將它浮動在左上方等。沒有真正看到圖像,很難說出你想要的東西。做/看起來像。 –

+0

stampy 6.png已經是我透明的背景圖片。我想要做的是讓我的圖像(gaoosh.gif)可點擊。 – montocore

0

變化100%,價值就像少了10%,圖像隱藏的鏈接,這就是爲什麼你不能點擊它。

+3

'圖像隱藏了鏈接,這就是爲什麼你可以點擊它.'不應該這樣'圖像隱藏鏈接,這就是爲什麼你不能點擊它' –

+0

修改!感謝您的反饋意見:) – mongotop

0

原來我發現了一個解決方案!該「z-index的」我的代碼部分爲0(這表明它在我的圖像(gaoosh.gif)具有更高的優先級,這樣,我插入這個方便的一段代碼和:

h1{ 
position: relative; 
top: 30px; 
left: 50px; 
z-index: 1; 

} 

瞧! 但是,無論如何,我想感謝你們所有幫助我回答我的問題的人。

相關問題