弃用
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.

ime-mode CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete.

/* Keyword values */
ime-mode: auto;
ime-mode: normal;
ime-mode: active;
ime-mode: inactive;
ime-mode: disabled;
/* Global values */
ime-mode: inherit;
ime-mode: initial;
ime-mode: unset;
					

ime-mode property is only partially and inconsistently implemented in browsers. It was introduced by Microsoft with Internet Explorer 5 as a proprietary extension: -ms-ime-mode Attribute | imeMode Property .

注意: In general, it's not appropriate for a public web site to change the IME mode. This property should only be used for private web applications or to undo the property if it was previously set by legacy code.

句法

ime-mode property is specified using one of the keyword values listed below.

auto

No change is made to the current input method editor state. This is the default.

normal
The IME state should be normal; this value can be used in a user style sheet to override the page's setting. This value is not supported by Internet Explorer.
active
The input method editor is initially active; text entry is performed through it unless the user specifically dismisses it. Not supported on Linux.
inactive
The input method editor is initially inactive, but the user may activate it if they wish. Not supported on Linux.
disabled

The input method editor is disabled and may not be activated by the user.

描述

Unlike Internet Explorer, Firefox's implementation of ime-mode allows this property on <input type="password"> . However, this makes for a bad user experience, and password fields should not enable the IME. Users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following CSS into their user stylesheet:

input[type=password] {
  ime-mode: auto !important;
}
					

The Mac version of Gecko 1.9 (Firefox 3) can't recover the previous state of the IME when a field for which it is disabled loses focus, so Mac users may get grumpy when you use the disabled 值。

形式定义

初始值 auto
适用于 text fields
继承 no
计算值 如指定
动画类型 discrete

形式句法

auto | normal | active | inactive | disabled
					

范例

Disabling input method support

This example disables input method support for a form field. In the past, this was commonly used on fields that entered data into databases which didn't support extended character sets.

<input type="text" name="name" value="initial value" style="ime-mode: disabled">
					

注意: You shouldn't rely on disabling IME to prevent extended characters from passing through your form. Even with IME disabled, users can still paste extended characters into your form's fields.

规范

规范 状态 注释
CSS Basic User Interface Module Level 3
The definition of 'ime-mode' in that specification.
推荐 Initial definition. Makes ime-mode officially obsolete.

浏览器兼容性

The compatibility table on 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
ime-mode 弃用 非标 Chrome 不支持 No Edge 不支持 12 — 79
不支持 12 — 79
不支持 12 — 79 Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Firefox 完整支持 3 IE 完整支持 5
完整支持 5
完整支持 8 Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

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

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

弃用。不要用于新网站。

弃用。不要用于新网站。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

元数据

  • 最后修改: