Skip to content

Instantly share code, notes, and snippets.

@elizad
Created May 8, 2020 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elizad/cb8cd8ea60ad0da08b04fd7549ce3076 to your computer and use it in GitHub Desktop.
Save elizad/cb8cd8ea60ad0da08b04fd7549ce3076 to your computer and use it in GitHub Desktop.
How to disable a link using only CSS?
.not-active {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
<a href="link.html" class="not-active">Link</a>
or js
$('a.current-page').click(function() { return false; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment