Categories
CSS

How to disable clicking inside div with CSS?

Spread the love

To disable clicking inside div with CSS, we set the pointer-events style to none.

For instance, we write

div#foo {
  pointer-events: none;
}

to set the pointer-events CSS property to none for the div with ID foo. to disable clicking on the div with ID foo.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *