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

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?

--
Mounir

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