Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
css如何设置不可点击_创想鸟

css如何设置不可点击

css设置不可点击的方法是使用【pointer-events: none;】用来禁用鼠标的事件,通过其他方式绑定的事件还是会触发的,比如键盘事件等。

css如何设置不可点击

本教程操作环境:windows7系统、css3版,DELL G3电脑。

css设置不可点击的方法:

css代码:

.disable {pointer-events: none;}

示例:

立即学习“前端免费学习笔记(深入)”;

const disabled = true;  .disabled {      pointer-events: none;      // 设置pointer-events: none;再设置cursor是没有效果的  }

效果图:

1cfd66068a05fd61cb1c86b352fe817.png

注意:

pointer-events 的值为 none 时,如果元素上绝对定位,那在它下一层的元素可以被选中。

pointer-events: none; 只是用来禁用鼠标的事件,通过其他方式绑定的事件还是会触发的,比如键盘事件等。

如果将一个元素的子元素 pointer-events 设置成其他值(比如:auto),那么当点击子元素时,还是会通过事件冒泡的形式出发父元素的事件。

相关教程推荐:CSS视频教程

以上就是css如何设置不可点击的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1619784.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
css滚动条的宽度怎么设置
上一篇 2025年12月24日 06:51:07
css怎么设置图片边框
下一篇 2025年12月24日 06:51:14

相关推荐

发表回复

登录后才能评论
关注微信