0

Possible Duplicate:
CSS previous sibling selector

I'm exploring CSS3 and all I can do with only pure HTML/CSS3, and I've come across a little problem I can't find a solution to.

I have a few <div>s with the style float:left;. When I hover on the first one, I want to apply some CSS to the second one. Pretty easy, I just use div.div1:hover + div and it's all good. But what about the other way around? If I hover the second <div>, how can I apply some CSS to the first <div>?

I can use any CSS, I don't really care about browser compatibility, I just want to explore how far I can go with pure CSS3.

Community
  • 1
  • 1
Samuel Bolduc
  • 18,163
  • 7
  • 34
  • 55
  • 1
    Nope, there's no way for CSS to look backwards. You either need to use JavaScript DOM manipulation or rearrange your floating elements (try floating something right instead?) so they're in the desired order. – Blazemonger Jan 09 '13 at 14:15
  • 1
    You have no idea how many times this question has been asked here. – Asad Saeeduddin Jan 09 '13 at 14:15

0 Answers0