How to set the button to be unclickable in css

coldplay.xixi
Release: 2023-01-05 16:13:05
Original
5093 people have browsed it

How to set the button to be unclickable in css: 1. The display state when the button is not clickable [cursor: not-allowed]; 2. The original event of the button cannot be implemented [pointer-events:none].

How to set the button to be unclickable in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

How to set the button to be unclickable with css:

We can add two css styles: "cursor: not-allowed" and "pointer-events:none" to the button Make the button unclickable.

The button is not clickable mainly due to two manifestations:

1. The display state when the button is not clickable

cursor: not-allowed

Style demonstration:

<style> 
    input[readonly]   //readonly:后台能接收此input框传值
    {
         background:#dddddd; //为带有readonly的input框添加背景颜色
         cursor: not-allowed  // 表示一个红色的圈加一个斜杠
    }
</style>
Copy after login

2. The original events of the button cannot be implemented

pointer-events:none

Style demonstration:

<style> 
    input[disabled] //disadled:后台不可接收此input传值
    {
         background:#dddddd; //为带有disabled的input框添加背景颜色
         pointer-events:none;//鼠标点击不可修改
    }
</style>
Copy after login

Related tutorial recommendations: CSS video tutorial

The above is the detailed content of How to set the button to be unclickable in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!