Simply set none
for pointer-events
in CSS, if you want to avoid receiving click events for an element or you want it to be click-through:
.no-click {
pointer-events: none;
}
Copied to clipboard!
This comes especially useful if you have decorative elements covering another element that should receive click events. By using the above property, you can make sure that the click goes right through the element.


Resources:
Remove ads📚 Get access to exclusive content
Want to get access to exclusive content? Support webtips with the price of a coffee to get access to tips, checklists, cheatsheets, and much more. ☕
Get access