W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: Styling HTML placeholder attribute

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Tue, 22 Jan 2013 15:58:51 +0100
Message-ID: <50FEA92B.20500@kozea.fr>
To: Mounir Lamouri <mounir@lamouri.fr>
CC: www-style@w3.org
Le 22/01/2013 00:22, Mounir Lamouri a écrit :
> Hi,
> Styling forms element is generally speaking painful and even the very
> simple HTML placeholder attribute follows that rule. Currently, as most
> form control styling, it is proprietary.
> The current situation seems to be:
> - Webkit: ::-webkit-input-placeholder pseudo-element;
> - IE10: :-ms-input-placeholder pseudo-class;
> - Gecko18-: :-moz-placeholder pseudo-class;
> - Gecko19+: ::-moz-placeholder pseudo-element;
> - Presto: nothing.


If multiple implementations have it, we should specify it.

> Recently, Gecko moved from a pseudo-class to a pseudo-element [1] for
> multiple reasons. […]

If an input’s placeholder can have CSS properties that are not the same 
as the input itself, it is a pseudo-element. The only meaning I can 
imagine for a :placeholder pseudo-class is selecting inputs that are 
currently showing their placeholder.

I seem that IE10 and Gecko18- are using pseudo-class *syntax* for 
something that is really a pseudo-element.

> I believe that we should be able to easily push this to css3-ui

Or maybe selectors4, depending on

> FWIW, the current Gecko implementation can be described as follow:
> - pseudo-element;
> - restricted set of rules: as '::first-line' + 'opacity';
> - default style: "opacity: 0.54;" [2].

The last bit is in the UA stylesheet, isn’t it?

Simon Sapin
Received on Tuesday, 22 January 2013 14:59:16 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:23 UTC