Click to See Complete Forum and Search --> : change background colour
Webskater
09-10-2003, 05:54 AM
Hello
Can anyone tell me please how to change the background colour of a cell in a table when you mouseover it.
Thanks for any help.
96turnerri
09-10-2003, 06:01 AM
just one individual cell?
96turnerri
09-10-2003, 06:09 AM
<HEAD>
<style>
.tditem {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
color: gray;
}
</style>
</HEAD>
<BODY>
<center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td onmouseover="bgColor='blue'" onClick="window.location='page1.html'" style="cursor:hand" onmouseout="bgColor='#FFFFFF'" bgcolor="#FFFFFF" width="100" align="center" valign="center"><b><font color="#D5D5D5">
<a href="page1.html" class="tditem">
Item 1</a></font></b></td>
<td width="1" align="center">|</td>
<td onmouseover="bgColor='blue'" onClick="window.location='page2.html'" style="cursor:hand" onmouseout="bgColor='#FFFFFF'" bgcolor="#FFFFFF" width="100" align="center" valign="center"><b><font color="#D5D5D5">
<a href="page2.html" class="tditem">
Item 2</a></font></b></td>
<td width="1" align="center">|</td>
<td onmouseover="bgColor='blue'" onClick="window.location='page3.html'" style="cursor:hand" onmouseout="bgColor='#FFFFFF'" bgcolor="#FFFFFF" width="100" align="center" valign="center"><b><font color="#D5D5D5">
<a href="page3.html" class="tditem">
Item 3</a></font></b></td>
</tr>
</table>
</center>
</body>
Webskater
09-10-2003, 06:21 AM
Thanks for your answer. Just what I needed. I was using a function to change the className of the cell but sometimes only the area behind the text in the cell changed colour, other times the whole area of the cell changed colour! Enough to send you barking.
Thanks again.
96turnerri
09-10-2003, 06:25 AM
not a problem obviously this scipt needs some editing i.e. the colours etc. but glad i could be of help