January 8th, 2004, 12:00 PM
using css class to handle events
is there a way I can do something similar to this?
onMouseOver: background: #000080
onMouseOut: background: #ffffff
I would like to have css classes that encapsulate all of the event handlers that I need to reduce the redundant html in my pages.
January 8th, 2004, 12:33 PM
in standard compliant browsers you can use the pseudo-class hover on any element.
January 8th, 2004, 01:34 PM
Thanks for your reply.
can handle events like onclick and blur in a similar manner?
January 15th, 2004, 09:45 AM
CSS event handling
I've been searching for the answer to this too, but it looks like unfortunately Microsoft Internet Explorer (my browser, and let's face it, almost everybody elses) can't handle :hover on anything but the <a> tag.
Fortunately, IE offers HTC behaviors, which offer amazing functionality and event handling, but I'm a bit suspicious that Netscape and co might not be able to use them.
Any high level users listening who can add to this?