On Wed, 28 Jan 2009 11:54:09 -0800, Dylan Wilbanks wrote:
> Someone I know came to me with a problem: he wants his print stylesheet to 
> not apply a
> style when a link contains an image.
>
[sample code stripped]
>
> The generated content appears around the example link AND the linked image 
> when you
> print it. He doesn't want it to appear around the linked image.
>
> I thought that using the :not selector was the solution: 
> a:not([href*="flickr"]):before
> { content: " ["; color: #000; text-decoration: none; } 
> a:not([href*="flickr"]):after {
> content: " " attr(href) "] "; color: #000; text-decoration: none; }
>
> But there are two obvious problems:
> 1. Anchor links are now getting generated brackets thrown around them 2. If 
> he switches
> away from Flickr or links to an image on a non-Flickr, he has to add a new 
> exception
> every time
>
> I know there's a way in XSLT to test for a child element, but it doesn't seem 
> like you
> can do the same in CSS.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Correct. You can't.

> Is there a simple, elegant solution I'm missing here?

Simple? Elegant? Depends. If you know any PHP, adding a suitable CLASS
to links around images should solve it.

Cordially,
David
--

______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to