Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (20.3k 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.7k 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

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...