css operation control to achieve disable effect

php中世界最好的语言
Release: 2018-05-07 17:41:29
Original
4674 people have browsed it

This time I will bring you css operationControlTo achieve the disable effect, what are the precautions for css operation control to achieve the disable effect. The following is a practical case, let’s take a look.

Using js events can be used to prevent the default events of input, select, and checkbox , such as

event.preventDefault()
event.stopPropagation()
Copy after login

In fact, it can also be achieved using pure CSS, such as

input {
    pointer-events: none;
}
Copy after login

Then use CSS to make the input gray, and 50% transparency can achieve the disabled effect

input.disabled {
    pointer-events: none;
    opacity: 0.5;
}
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related matters on the php Chinese website article!

Recommended reading:

H5 WebWorkers multi-threaded development and use detailed explanation

H5 canvas convolution kernel image processing steps detailed explanation

The above is the detailed content of css operation control to achieve disable effect. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
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