W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [css3-ui] Styling the HTML5 input element placeholder

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 8 Apr 2011 13:15:26 -0700
Message-ID: <BANLkTin=rbAz_sHNr8-3KUBc3+W84ADnYQ@mail.gmail.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>, "Sharon Newman (COHEN)" <Sharon.Newman@microsoft.com>
On Fri, Apr 8, 2011 at 12:56 PM, Sylvain Galineau
<sylvaing@microsoft.com> wrote:
> Two implementations today let authors style the value of this attribute.
> Gecko exposes a pseudo-class, :-moz-placeholder [1]. Webkit uses a pseudo-element, ::-webkit-input-placeholder. As this attribute is now supported by at least three implementations and styling it will be desirable, agreeing on a styling entry point seems appropriate. I prefer the pseudo-class approach since the placeholder text's presence is a function of the control's state but I'm interested in hearing from others..

The problem with a pseudoclass is that the best default styling is to
use the normal input text color, but more transparent.  That ensures
that the placeholder text is always visible (assuming the original
text is, which we have to assume), but is clearly "less real" than
normal text.  However, there's no way to control text opacity
separately from the color.  Using a pseudo-element lets you just set
'opacity' on it and inherit the color by default.

> I assume css3-ui is the module for such a definition.


Received on Friday, 8 April 2011 20:16:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:45 UTC