Link to home
Start Free TrialLog in
Avatar of willsherwood
willsherwood

asked on

HTML CSS <span> how to get span to have scope over a DIV

I have a mouseover effect that works well for a span i have that spans text.
I'd like the hover effect to occur whenever the mouse is over any part of the rectangle area for the encompassing DIV.
I realize that SPANs are more for text, but is there another way to accomplish the scope for the DIV?

I've included the skeletal structure below.   Currently the onMouseOver works fine for hovering over the text.  I would like to somehow have the hover effect be triggered for mousing over anywhere in the Bar19 rectangular area.   I couldn't get anywhere by putting the span and/or mouseover surrounding or in combination with the DIV.  I may be missing something about how onMouseOver is intended to work across browsers/platforms.

any advice?
<div id='Bar19' class='bar' style='position: relative;background-color:#FFFF00; '>
   <div class='early' style='position: absolute; background-color:#FFFFCC; '></div>
   <span  style='position: absolute;'      onMouseOver=' etc' >Text</span>
</div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of vosk
vosk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willsherwood
willsherwood

ASKER

thanks, that turned out to be simple, i must not have tried that combination properly before.
Glad to help, and thank's for the A :)