W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [css3-content] "content" property, replaced elements, and width

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 9 May 2010 10:04:04 -0700
Message-ID: <g2wdd0fbad1005091004k6a73b1f2lcaf6eea3b29f0571@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, "Robert O'Callahan" <robert@ocallahan.org>, www-style list <www-style@w3.org>
On Sun, May 9, 2010 at 9:51 AM, L. David Baron <dbaron@dbaron.org> wrote:
> On Saturday 2010-05-08 12:05 -0700, Andrew Fedoniouk wrote:
>> David, do you remember any discussion of what should happen
>> if you have style:
>>
>> p { content: "test" }
>>
>> on DOM like this:
>>
>> <p>foo<span>bar</span></p>
>>
>> ?
>
> I presume it's rather like the real content of the p has
> 'display:none', except that you have the generated content instead.
>
>> p:hover { content: "test" }
>> case is also interesting.
>
> I'd think it's interesting in a manner similar to p:hover { display:
> none } or p:hover > * { display:none }.

In fact, the behavior is almost identical to this:

p:hover > * {
	display: none;
}
p:hover::before {
	content: "test";
}

Only with some extra magic that also hides the anonymous inline children of <p>.

On that note, what should happen with the following?

p { content: url(image); }
p::before { content: "foo"; }

I presume it should fall under the same "undefined" banner that
setting img::before does, correct?

~TJ
Received on Sunday, 9 May 2010 17:04:56 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:46 UTC