Sometimes, we want to disable HTML links with CSS.
In this article, we’ll look at how to disable HTML links with CSS.
How to disable HTML links with CSS?
To disable HTML links with CSS, we set the pointer-events
CSS property.
For instance, we write
a.disabled {
pointer-events: none;
}
to add pointer-events: none;
to disable clicks on links on links with the disabled
class.
Conclusion
To disable HTML links with CSS, we set the pointer-events
CSS property.