Disable a link using css

The answer is already in the comments of the question. For more visibility, I am copying this to here:

http://css-tricks.com/pointer-events-current-nav/

<a href="link.html" class="active">Link</a>

.active {
   pointer-events: none;
   cursor: default;
}

JS

CSS can only be used to change the style of something. The best you could probably do with pure CSS is to hide the link altogether.

What you really need is some javascript. Here’s how you’d do what you want using the jQuery library.

$('a.current-page').click(function() { return false; });

Leave a comment