好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css怎样设置按钮不能点击

css设置按钮不能点击的方法:1、按钮 不可点击 时的显示状态【cursor: not- Allowed 】;2、按钮原有的事件不能实现【pointer-events:none】。

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

css设置按钮不能点击的方法:

我们可以为按钮添加“cursor: not-allowed”与“pointer-events:none”两种css样式实现按钮不可点击。

按钮不可点击主要是两种表现:

1、按钮不可点击时的显示状态

cursor: not-allowed

样式演示:

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

2、按钮原有的事件不能实现

pointer-events:none

样式演示:

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

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

以上就是css 怎样 设置按钮不能点击的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css怎样设置按钮不能点击 全部内容,希望文章能够帮你解决 css怎样设置按钮不能点击 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css怎样设置按钮不能点击的详细内容...

  阅读:74次