Sometimes, we want to make elements unclickable with CSS
In this article, we’ll look at how to make elements unclickable with CSS.
How to make elements unclickable with CSS?
To make elements unclickable with CSS, we set the pointer-events property.
For instance, we write
div.child {
background: #fff;
pointer-events: none;
}
to add pointer-events: none;
to divs with class child to disable clicks on the divs.
Conclusion
To make elements unclickable with CSS, we set the pointer-events property.