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

Re: Styling HTML placeholder attribute

From: Philip Walton <philip@philipwalton.com>
Date: Wed, 23 Jan 2013 14:47:42 -0800
Message-ID: <CAGRhNhWpRqkxcrZ7C+VUeHF_E0GN=QatL40JF86-5gB9JMHUtA@mail.gmail.com>
To: Lea Verou <lea@w3.org>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Brad Kemper <brad.kemper@gmail.com>, Sylvain Galineau <sylvaing@microsoft.com>, Mounir Lamouri <mounir@lamouri.fr>, www-style list <www-style@w3.org>
On Wed, Jan 23, 2013 at 2:24 PM, Lea Verou <lea@w3.org> wrote:

2) Is there any other use case for a pseudoelement apart from opacity? I
> can't see any, but my imagination might be limited. :)


Before most browsers supported placeholders, it was pretty common to see
jQuery plugins polyfill this behavior. A common effect was to have the
placeholder start at a gray color, fade out when you focused on the
element, and then disappear completely as soon as you typed a single
character.

This would be impossible to achieve in pure CSS unless the placeholder were
a pseudo-element.

Here's a demo plugin that's pretty similar to what I used to see a lot:
http://jsfiddle.net/6HQWv/
Received on Wednesday, 23 January 2013 22:48:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT