As Matthew said, the selectors step down, so you could apply the active_menu id to the td, then use descendence(!) on the contained elements.
<td id="active_menu"><a>snip</a></td> #active_menu { styles } #active_menu a { styles } Regards Scott Swabey Lafinboy Productions www.lafinboy.com > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Matthew > Cruickshank > Sent: Wednesday, 14 September 2005 7:16 PM > To: wsg@webstandardsgroup.org > Subject: Re: [WSG] Style a parent element based on an id > selector of the child element > > > On Wed, 2005-09-14 at 16:56 +0800, Martin Smales wrote: > > > Is there a way to style the td element with a background > colour if an > > <a> element has a active_menu id? > > No, CSS Selectors don't allow this. They can only step down, not up. > > You could do the equivalent in JavaScript, or... well, a long > term strategy might be lobby browser makers to support XPath > or something. So basically I don't have any good advice for you. > > > .Matthew Cruickshank > http://holloway.co.nz/ > > ****************************************************** > The discussion list for http://webstandardsgroup.org/ > > See http://webstandardsgroup.org/mail/guidelines.cfm > for some hints on posting to the list & getting help > ****************************************************** > > ****************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************