Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

19
  • 145
    Don't forget the general sibling combinator ~ for 'cube is somewhere after container in the DOM and shares a parent'
    – robertc
    Commented Dec 21, 2010 at 18:50
  • 4
    That's pretty cool. Is there some source where I can find more information about that ? Is it supported by all browser, is it CSS3 ? Would be great to have some more info about that. Thanks so much!
    – Anonymous
    Commented Oct 19, 2011 at 10:35
  • 7
    +1 Great answer @Mike. What if #container is next to #cube, i.e. #container follows #cube?
    – PeterKA
    Commented Oct 2, 2014 at 4:58
  • 9
    What to do if the hovered element is inside the container(that we want to be effected) ??? For example: #cube:hover #container{Some CSS Effects} Commented Mar 3, 2015 at 15:19
  • 4
    Good answer !! What about if I want to change the parent when I hover the child. I think there is no selector for that.
    – Mikel
    Commented Mar 8, 2017 at 11:49