0 votes
1 view
in Web Technology by (22.4k points)

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.

1 Answer

0 votes
by (40.3k points)

Try using the code given below:

.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. 

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !