非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

Deprecated since Gecko 60 (Firefox 60 / Thunderbird 60 / SeaMonkey 2.57)
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the 兼容性表格 at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

In Mozilla applications, -moz-user-input determines if an element will accept user input.

/* Keyword values */
-moz-user-input: none;
-moz-user-input: enabled;
-moz-user-input: disabled;
/* Global values */
-moz-user-input: inherit;
-moz-user-input: initial;
-moz-user-input: unset;
					

For elements that normally take user input, such as a <textarea> , the initial value of -moz-user-input is enabled .

注意: -moz-user-input was one of the proposals leading to the proposed CSS 3 user-input property, which has not yet reached Candidate Recommendation (call for implementations). A similar property, user-focus , was proposed in early drafts of a predecessor of the CSS3 UI specification , but was rejected by the working group.

句法

none
The element does not respond to user input, and it does not become :active .
enabled
The element accepts user input. For textboxes, this is the default behavior. Please note that this value is no longer supported in Firefox 60 onwards ( bug 1405087 ).
disabled
The element does not accept user input. However, this is not the same as setting disabled to true, in that the element is drawn normally. Please note that this value is no longer supported in Firefox 60 onwards ( bug 1405087 ).

形式定义

初始值 auto
适用于 所有元素
继承 yes
计算值 如指定
动画类型 discrete

形式句法

auto | none | enabled | disabled
					

范例

Disabling user input for an element

input.example {
  /* The user will be able to select the text, but not change it. */
  -moz-user-input: disabled;
}
					

规范

Not part of any standard.

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-moz-user-input 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 完整支持 1 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
auto 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 完整支持 1 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
disabled 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 不支持 1 — 60 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 4 — 60 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
enabled 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 不支持 1 — 60 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 4 — 60 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
none 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 完整支持 1 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: