- From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
- Date: Mon, 10 May 2010 17:54:39 +0200
- 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 UTC