Back
Is there any way to disable a link using CSS?
I have a class called the current-page and want links with this class to be disabled so that no action occurs when they are clicked.
Try using the code given below:
.not-active { pointer-events: none; cursor: default; text-decoration: none; color: black;}
.not-active {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
<a href="link.html" class="not-active">Link</a>
Note: For browser support, refer to this link: https://caniuse.com/#feat=pointer-events.
31k questions
32.8k answers
501 comments
693 users