W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] Customize HTML5 forms placeholder style

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 22 Feb 2010 08:26:37 -0600
Message-ID: <dd0fbad1002220626y4c174ef7q6c9a5e16304d0dd4@mail.gmail.com>
On Mon, Feb 22, 2010 at 5:08 AM, Dean Edwards <dean at edwards.name> wrote:
> Yes, I'm suggesting redefining how :empty works. For elements that
> cannot have children it could mean having no content. e.g. An <input>
> with no value or an <img> with no src.
>
> It gets around the need for a new :placeholder pseudo-class:
>
> input[placeholder]:empty {
> ?color: red;
> }

To get it to act like implementations do, you have to use
"input[placeholder]:empty:not(:focus)".  That's pretty complex.  ^_^

> There is a small chance that it could break some pages I guess. If
> people are using *:empty than it may start matching some <input>
> elements.
>
> I always wanted a pseudo-class that could match <input> with no value.
> Extending :empty is probably a bad idea but something like :no-value
> would be useful.

I certainly see the value in such a thing.

~TJ
Received on Monday, 22 February 2010 06:26:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC