[thelist] css question, hover for div ?

Saila, Craig Craig.Saila at bgminteractive.com
Thu Sep 12 15:50:01 CDT 2002


> -----Original Message-----
> From: Eduardo Dominguez [mailto:lalo at teligens.com]
> Sent: September 12, 2002 4:43 PM

> I am trying to change the background color of a div when the
> mouse hovers. So far, I havent found out how to do this
> without JS. Is it possible ?

 div:hover { background: red; }

AFAIK, only works in Gecko-based browser like Mozilla (it's a CSS2
thing).

A more supported possibility is this:
 div a { display: block; }
 div a:hover { background: red; }
with this HTML:
 <div><a href="#">something</a></div>

Obvious drawback: it has to be a link.

--
Cheers,

Craig Saila
------------------------------------------
craig at saila.com : http://www.saila.com/
------------------------------------------



More information about the thelist mailing list