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

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

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Mon, 10 May 2010 17:54:39 +0200
Message-ID: <4BE82C3F.4090400@disruptive-innovations.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
Le 10/05/10 17:47, Tab Atkins Jr. a écrit :

>>   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. ^_^

No problem: add a child element to the <img> in the markup... As dbaron
said, it's hidden as if it were "display: none", rendering is based on
the content property and you can then have a ::before.
The _rendering_ is a replaced element, but the DOM is still here...

</Daniel>
Received on Monday, 10 May 2010 15:55:14 GMT

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