Home > Web Front-end > CSS Tutorial > How to disable click events of elements in css

How to disable click events of elements in css

王林
Release: 2020-09-28 16:38:12
forward
6700 people have browsed it

How to disable click events of elements in css

In actual work, if we need to prohibit the click event of an element, we can set the pointer-events attribute of the element to none.

(Recommended tutorial: CSS tutorial)

is as follows:

How to disable click events of elements in css

Test code:

.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.6;}
Copy after login

Among them, pointer-events: none; is a new attribute of CSS3, which means that mouse click events are prohibited. When this attribute is present in the element, all link and click events will be invalid.

The above is the detailed content of How to disable click events of elements in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template