Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorMcChicken
    • CommentTimeJan 4th 2006
     permalink
    Hi everyone ! I've been searching this for a while, and still have never found an answer, so here I am.
    I would like to create a css rule that will only apply to a parent div that has a certain child. More precisely, I would like to style that parent div when one of its sub div contains a specific link. I already found the selector to modify that link (ie : a[href="http..."]), but is it possible to change its parent accordingly ?
    •  
      CommentAuthornifkin
    • CommentTimeJan 4th 2006 edited
     permalink
    is it possible to change its parent accordingly ?

    using only CSS? yes.

    using only CSS and working in IE/PC? no.

    for cross-browser support you'll need a JS solution (either to find the affected link and then modify the parent div accordingly, or something like the IE7 lib to add better CSS support to IE).

    Actually, let me amend that, I thought there was a way to do it in CSS but I don't see any selectors that let you choose the parent of something to apply a style to. A JS solution is probably the way to go for this.
  1.  permalink
    http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#content-selectors

    That is CSS3 and is probably what you're looking for since it applies the styling to the whole block. It is still just a draft so as the above poster said, a JS solution is the best for this, me thinks.
Add your comments
    Username Password
  • Format comments as (Help)