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

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

From: Mounir Lamouri <mounir.lamouri@gmail.com>
Date: Fri, 08 Apr 2011 13:28:15 -0700
Message-ID: <4D9F6FDF.1090109@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Sylvain Galineau <sylvaing@microsoft.com>, "www-style@w3.org" <www-style@w3.org>, "Sharon Newman (COHEN)" <Sharon.Newman@microsoft.com>
On 04/08/2011 01:15 PM, Tab Atkins Jr. wrote:
> 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 think we can do the same thing with the pseudo-class approach if 
::value was implemented, can't we?

Received on Friday, 8 April 2011 20:31:19 UTC

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