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].
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>
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>
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!