Previous Message
Next Message

selectors question

Sent by Alastair Campbell on 17 May 2005 14:02


Although not mainstream yet, I'm starting to add CSS2/3 selectors to a 
site for a specific purpose: identifying link types.

For example, for pdf files, I add a small icon to the right of the link 
with: a[href$=".pdf"]
And for email links: a[href^="mailto"]
( is the example, standards aware browser needed to see 
the effect.)

But I'm having less success with identifying external links. I can 
easily target external links with: a[href^="/outbound.php"]

(My outbound links go through a little server script, using "http:" 
would work for most people.)

What I can't do is remove them for image links, which appear quite 
strange e.g the first image in the content of:

I thought that using E:not or E:empty might work (see

However, it seems that the text in the link doesn't count as an HTML 
element, but it isn't empty either...

What I need is something that says "Apply X to link elements that do not 
contain an image", but CSS selectors are fairly one way, going down the 
DOM. As text doesn't count as an element, I'm fairly stuck.

Any ideas? I'm hoping I've just missed something obvious...


css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Possibly related: