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

[whatwg] Customize HTML5 forms placeholder style

From: Dean Edwards <dean.edwards@gmail.com>
Date: Mon, 22 Feb 2010 00:11:23 +0000
Message-ID: <4B81CBAB.9030908@gmail.com>
On 21/02/2010 21:46, Aryeh Gregor wrote:
> One implementation idea would be a pseudo-element, with something like
> this in the UA stylesheet:
>
> ::placeholder { opacity: 0.6; }


Why not just extend :empty to include <input> with no value?

It reads nicely:

input[required]:empty:after {
   content: "This value is required";
   color: red;
}

-dean
Received on Sunday, 21 February 2010 16:11:23 UTC

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