2017-04-19 34 views
-5

的標籤禁用屬性如何爲HTML 標籤禁用的屬性我試試這個如何在HTML

<a href="#" disabled> 
    My Link 
</a> 
+0
+0

顯然的重複[http://stackoverflow.com/questions/7654900/how-do-you-make-an-anchor-link-non-clickable-or-disabled#],[ http://stackoverflow.com/questions/10276133/how-to-disable-html-links/10276157#10276157] – 2017-04-19 10:21:01

回答

1

a.disabled { 
 
    pointer-events: none; 
 
    color: #ccc; 
 
}
<a href="www.google.com" class="disabled">Click me</a>

請檢查上面的代碼。它可以幫助你。

1

<a>標籤沒有disabled屬性。看here

0

你可以試試下面的代碼: -

<style> 
.disabled{ 
    /*Disabled link style*/ 
    color:black; 
} 
</style> 

<a class="disabled" href="javascript:void(0)">LINK</a> 
0

有這樣(<a href="#" disabled>)爲 「A」 的標籤也沒有殘疾人屬性。你可以嘗試禁用使用CSS,所以只需在你的「a」標記中加入類&,然後禁用CSS。

<a href="#" class="disable"> 
    My Link 
</a> 
.disable { 
    pointer-events: none; 
    cursor: default; 
}