[thelist] onmouseover color change for <tr>

Joe Crawford joe at artlung.com
Sat Sep 8 13:42:17 CDT 2001


on 9/8/2001 11:33 AM, ted serbinski at tss24 at cornell.edu wrote:

>> you mean, other than the obvious of not using the bgcolor attribute?
>> 
>> i'm afraid that if you need to use that attribute you're out of luck.
>> otherwise, just remove it and apply the bgcolor via css.
> 
> no i mean using bgcolor. like below:
> 
> onMouseOut="this.style.backgroundColor='#003366'
> 
> it just doesn't seem to override a color i've specified in the actual tag,
> <td bgcolor="#ffcc99">
> 
> so basically this is only going to work if i've specified no bgcolor?

Why not specify the color with a class or with
style="background-color:#036;" -- that's over-rideable with CSS (and
viewable in browsers for which <tr> onmouseovers react:

<style type="text/css">
<!--
body { background: #FFF }
.yellowThing {background-color: #FF9; }
.whiteThing { background-color: #FFF; }
.redThing { background-color: #F00; }
//-->
</style>

<table cellspacing="0" cellpadding="3" border="0">
<tr onmouseover="this.className='yellowThing';"
onmouseout="this.className='whiteThing';"><td>hello</td><td>hello</td></tr>
<tr onmouseover="this.className='yellowThing';"
onmouseout="this.className='whiteThing';"><td>hello</td><td>hello</td></tr>
<tr onmouseover="this.className='yellowThing';"
onmouseout="this.className='whiteThing';"><td>hello</td><td>hello</td></tr>
<tr onmouseover="this.style.background='#F00';"
onmouseout="this.style.background='#FFF';"><td>hello</td><td>hello</td></tr>
</table>

HTH,
    Joe

--  
...........  Joe Crawford : thinking and design about the web
.... enigmatic narcissism and miscellany : http://artlung.com
.... community instigator : http://WebSanDiego.org
.... San Diego, California, USA .....................AAAFNRAA





More information about the thelist mailing list