本教程操作环境:windows10系统、css3&&html5版本、dell g3电脑。
css3怎么设置input不可编辑pointer-events 属性定义元素是否对指针事件做出反应。
语法为:
pointer-events: auto|none;
属性值 描述如下:
auto 默认值。元素对指针事件做出反应,比如 :hover 和 click。
none 元素不对指针事件做出反应。
initial 将此属性设置为其默认值。
inherit 从其父元素继承此属性。
示例如下;
<!doctype html><html><head><style> .input1 { pointer-events: none;}.input2{ pointer-events: auto;}</style></head><body>不可编辑:<input type="text" class="input1"><br>可编辑:<input type="text" class="input2"></body></html>
输出结果:
(学习视频分享:css视频教程)
以上就是css3怎么设置input不可编辑的详细内容。
