[ Solved – 3 Answers] Disable link using css

[Solved – 3 Answers] HTML - CSS - Disable link using css - Is there any way to disable a link using CSS?If you have a class called current-page

Is there any way to disable a link using CSS?

If you have a class called current-page and want links with this class to be disabled so that no action occurs when they are clicked.

  • CSS can only be used to change the style. The best way you could probably do with CSS is to hide the link altogether.
  • What you really need is some javascript. Here’s how can you do the javascript function and what you want using the jQuery library.
  • $(‘a.current-page’).click(function() { return false; });

CSS can’t do that because it is only for presentation.
Your options are:

Here the solution for Bootstrap Disabled Link and Bootstrap Disabled Button.

Bootstrap Disabled Link

<a href="#" class="btn btn-primary btn-lg disabled" role="button">Primary link</a>
<a href="#" class="btn btn-default btn-lg disabled" role="button">Link</a>

Bootstrap Disabled Button but it looks like link

<button type="button" class="btn btn-link">Link</button>
READ  [solved – 5 Answers] Set the table column width constant regardless of the amount of text in its cells

About the author

Wikitechy Editor

Wikitechy Editor

Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.