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: Mon, 10 May 2010 08:47:35 -0700
Message-ID: <AANLkTin-qLkM48GXxBaKJvXzc5jUk5EDU44urSEbHLOP@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Mon, May 10, 2010 at 8:02 AM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> Le 09/05/10 19:04, Tab Atkins Jr. a écrit :
>
>> p { content: url(image); }
>> p::before { content: "foo"; }
>>
>> I presume it should fall under the same "undefined" banner that
>> setting img::before does, correct?
>
> Sigh.
> Imagine a CMS where the following styles are enforced by the system:
>
>  img.companyLogo {
>    content: url(logo.png);
>  }
>
>  img:not(.validatedByComDpt).companyLogo::before {
>    background-color: red;
>    color: black;
>    font-weight: bold;
>    content: "VALIDATION REQUIRED";
>  }

I understand the use-case, but that doesn't say anything about the
problem.  ::before is a child of the element it's specified on.
Replaced elements officially have no children that CSS can know about.

What you want is ::outside::before. ^_^

~TJ
Received on Monday, 10 May 2010 15:48:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT