Design Directory Discussion Forum Design Job Board Add Your Site Post a Message Post a Job / Gig

HomeMain → Re: css tricks.

hey everyone.
so i'm trying to have the background color of a <div> change color on mouse over. but the thing is, i don't want to use <a>. is there a command to put in the "onmouseover" within the <div> to change the "id" or some similar trick?

thanks.
The way you describe it, you can only achieve that effect in Firefox using CSS alone. IE won't do pesudo actions on any element other than anchor tags.

The other way of doing this is to use JavaScript to switch class names and those two class names can use different background colours. This will work in both browsers.

Hope that helps.
Hi Brandon,

There's a nice little tutorial to achieve the desired effect at Smiley Cat:

http://www.smileycat.com/miaow/archives/000230.php

Hope that helps,

Gav

Attachment
MagnifyClick to Enlarge