By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,516 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,516 IT Pros & Developers. It's quick & easy.

Change Background Color

P: n/a
Hello,

Could someone, please, tell me how to change the background color of
div when the mouse is hover it?

Thanks,
Miguel

Oct 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2006-10-19, shapper <md*****@gmail.comwrote:
Hello,

Could someone, please, tell me how to change the background color of
div when the mouse is hover it?

Thanks,
Miguel
div:hover {background-color: yellow;}
Oct 19 '06 #2

P: n/a
Ben C wrote:
On 2006-10-19, shapper <md*****@gmail.comwrote:
>>Could someone, please, tell me how to change the background color of
div when the mouse is hover it?
div:hover {background-color: yellow;}
But I needn't expect this to work on IE (IE <7 anyway). Right?

--
John
Oct 19 '06 #3

P: n/a
On 2006-10-19, John Hosking <Jo**@Hosking.name.invalidwrote:
Ben C wrote:
>On 2006-10-19, shapper <md*****@gmail.comwrote:
>>>Could someone, please, tell me how to change the background color of
div when the mouse is hover it?
div:hover {background-color: yellow;}

But I needn't expect this to work on IE (IE <7 anyway). Right?
Worth a try. Otherwise you have to use JS, for which the standard
function is addEventListener, but in IE you use I think attachEvent
instead.

Then in the handler you just go (roughly):

event.node.style.backgroundColor = "yellow";
Oct 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.