ime-mode - CSS: Cascading Style Sheets 编辑

Deprecated

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 compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The 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;

The 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.

Note: 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.

Syntax

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

Values

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.

Description

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 value.

Formal definition

Initial valueauto
Applies totext fields
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

auto | normal | active | inactive | disabled

Examples

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">

Note: 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.

Specifications

SpecificationStatusComment
CSS Basic User Interface Module Level 3
The definition of 'ime-mode' in that specification.
RecommendationInitial definition. Makes ime-mode officially obsolete.

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:131 次

字数:6487

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文