この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. 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.

Note: The ::-moz-placeholder pseudo-element was introduced as a replacement for the :-moz-placeholder pseudo-class that was deprecated in Firefox 19. Since Firefox 51, this feature is also available as the standard ::placeholder pseudo-element.

The ::-moz-placeholder CSS pseudo-element is a Mozilla extension that represents any form element displaying placeholder text. This lets you customize the appearance of the placeholder text, which is a translucent gray color by default.

input::-moz-placeholder {
  color: blue;
}

Example

HTML

<input placeholder="Type something here!">

CSS

input::-moz-placeholder {
  color: red;
  font-style: italic;
}

Result

Specifications

Not part of any specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support ? 19.0 (19.0)[1][2] ? ? ?
Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support ? 19.0 (19.0)[1][2] ? ? ? ?

[1] Firefox applies a default style of opacity: 0.54 to placeholder text. See bug 556145. Most other major browsers don't currently share this particular default style for their placeholder text pseudo-elements or pseudo-classes.

[2] Before version 19, Gecko implemented this functionality with a pseudo-class :-moz-placeholder. See bug 737786.

See also

ドキュメントのタグと貢献者

 最終更新者: mfluehr,