W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [selectors-nonelement] First draft of a new spec for selecting non-element nodes

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Fri, 14 Feb 2014 19:42:57 -0800
Message-ID: <CALRQH7-jsVGgZOJV1O+q0b4d70y03Z_Rcw5HCUON4K4mtzjc3A@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style list <www-style@w3.org>
On Fri, Feb 14, 2014 at 6:30 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Fri, Feb 14, 2014 at 6:28 PM, Andrew Fedoniouk
> <news@terrainformatica.com> wrote:
>>>> I can imagine something like this:
>>>>
>>>> input[type=number]:empty::attr(placeholder) {
>>>>   display:block;
>>>>   color:grey;
>>>> }
>>>
>>> What is this supposed to do?
>>
>> When <input type=number> is empty show
>> content of the 'placeholder' attribute in its place
>> with the given styling.
>
> So it's exactly equivalent to:
>
> input[type=number]:empty[placeholder]::before {
>   content: attr(placeholder);
>   display: block;
>   color: grey;
> }
>
> ?
>

As you know ::before and ::after insert [pseudo] elements
in content flow of matched element.
input, img, etc. have no content in DOM sense so
::after ::before do not work for them.

In any case ::after/::before are just two pseudo elements
and sometimes[1] you will need more.

[1] http://stackoverflow.com/questions/10855890/two-after-pseudo-elements


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Saturday, 15 February 2014 03:43:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC