W3C home > Mailing lists > Public > www-style@w3.org > November 2001

How to select anonymous elements

From: Tim Phipps <Tim.Phipps@st.com>
Date: Thu, 8 Nov 2001 09:48:37 -0500 (EST)
Message-Id: <E161qMY-00023j-00.2001-11-08-14-41-02@silver>
To: www-style@w3.org
Hi stylists,
    Is there a way to specify anonymous elements? * doesn't match. My user style sheets has this:

  A:Link * {
    Background: Blue;
    Color: Yellow;
    Border-Color: Yellow;
    Text-Decoration: None;
  }
  A Img, A:Link Img {
    Background: Transparent!Important;
  }

i.e. I'm trying to get hypertext links to have a solid background but not if they have pictures (it spoils all those lovely anti-alias buttons that web designers love).

I did think of using:

A:Link { Background: Blue; Color Yellow; }
A:Contains(Img) { Background: Transparent; }

but since I haven't found a browser that does :contains() I can't try it.

Also
A:Link { Background: Blue; Color: Yellow; }
A:Link Img { Background: Transparent; }
doesn't give the desired effect since the Img is a child of the <A> and it's blue background shines through the transparent parts of the Img.

Cheers,
Tim.
Received on Thursday, 8 November 2001 13:37:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:11 GMT