tags:

views:

23

answers:

1

On which elements the attribute hover works on all browsers ?

I guess the element is cross-browser. What about ? Is there any other element ?

For cross-browser I mean working on Safari, Chrome, Firefox, IE 9, 8 and possibly 7.

+2  A: 

It's not dependent on which element it is applied to, apart from in IE5/6.

  • IE 5/6 supports it only on links.
  • IE 7 supports :hover, but not :active, on all elements.

Put this link on your bookmarks - it will save you plenty of time.

http://www.quirksmode.org/css/contents.html

So for IE7+ and all other browsers, it'll work fine.

RPM1984
ok thanks. One more thing.. if I want to change background of an object when I move the mouse over another object, I can only make it with javascript, right ?
Patrick
@Patrick - yes, AFAIK with hover CSS you can only apply styles to the element which hovered. So yes, you'd need to hook into the hover event and explicity get a hold of the other object you want to style. Of course with the magic of jQuery this is a piece of cake. Good luck!
RPM1984