0

I've been playing around with CSS and using the > operator to select child elements on hover.

I'm trying to hide two divs while hovering over another. However I am not sure how to select an external div? I've got this so far:

http://jsfiddle.net/s3rdqwuq/

   .shares:hover>.catlink {
    display:none;
}

.shares:hover>.shareimage {
    display:none; 
}

The issue is with the last two parts of the CSS file (above). The > only selects child elements so in this example on hover of "shares" I want to hide "catlink" "shareimage" and show "homenetworks".

Is there a way to select external elements on:hover to achive what I am trying?

Thanks!

KojoSlayer
  • 29
  • 6
  • 2
    You can only access child or sibling elements with CSS. You'll have to use javascript if you want to access an element outside of the element's DOM tree. – kumarharsh Nov 14 '14 at 11:10
  • Ah! that wasn't what I was hoping. I'll have to re-think how I do this then. Thank you! – KojoSlayer Nov 14 '14 at 11:15
  • possible duplicate of [How to affect other elements when a div is hovered](http://stackoverflow.com/questions/4502633/how-to-affect-other-elements-when-a-div-is-hovered) – Turnip Nov 14 '14 at 11:18

0 Answers0