What is the HTML Code for changing a button’s color on a mouseover?

All I need is the html code for making a simple thing like a rectangle change color when a user’s mouse hovers over it! Please be clear as to where in the code I must supply information to customize the button’s color, or anything else.

Technically, you don’t do this with html, but with CSS, and there’s more than one way to do it with CSS, but it’s possible that one or more of those techniques won’t work on all browsers. The simplest and cleanest way is probably with the "hover" pseudo-class, which the first link describes. Browser support for pseudo-classes is somewhat new, however (doesn’t work on IE6). The second link describes how to use the "mouseover" and "mouseout" events to change the background color.

Technorati Tags: , , , , , , , , , , ,