The ime-mode
CSS property controls the state of the input method editor for text fields. According to the spec:
"ime-mode" is a property somewhat implemented in some browsers, that is problematic and officially obsoleted by this specification...
User agents are instructed by the spec to not support ime-mode
and authors are advised not to use it, unless to undo the property if it was previously set by legacy code. It was introduced by Microsoft with Internet Explorer 5 as a proprietary extension: -ms-ime-mode Attribute | imeMode Property
Initial value | auto |
---|---|
Applies to | text fields |
Inherited | no |
Media | interactive |
Computed value | as specified |
Animation type | discrete |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
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;
auto
normal
active
inactive
disabled
auto | normal | active | inactive | disabled
<input type="text" name="name" value="initial value" style="ime-mode: disabled">
This example disables input method support for a field. This was a common practice for fields that enter data into databases that don't support extended character sets, for example. However:
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 Macintosh 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.
Specification | Status | Comment |
---|---|---|
CSS Basic User Interface Module Level 3 The definition of 'ime-mode' in that specification. | Candidate Recommendation | Initial definition |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | No support | (Yes) | 3.0 (1.9) | 5.0 [1] | No support | No support |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | (Yes) | ? | ? | ? | ? |
[1] IE8 introduced -ms-ime-mode
as a vendor-prefix for ime-mode
. Don't use the -ms-
prefix.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode