Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing <td> bgcolor onmousover

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I've got a series of cells in my calendar - some are have a pale blue background and some have a white background

<style>
.darkcalcell
{
border-bottom: 1px solid #819BAC;
background-color : D8DEF6;
}

.lightcalcell
{
border-bottom: 1px solid #819BAC;
background-color : white;
}
</style>

Then I have

<td class="darkcalcell">

If I want a cell to turn green when the mouse goes over it how do I go about this? Do I have to set up two more styles - eg lightcalcellon, lightcallcelloff, darkcalcellon and darkcaloff?

Thanks very much

Ed
 
Not necessarily so many classes. You could simply have one class for hovering over and you would then append the class rather than change it. So you would have:
Code:
<td class="darkcalcell hover">
And in CSS the hover class would overwrite some of the other classes.

Of course, if you do not have to support IE6 (oh how nice that would be), you could just use :hover pseudo class on the td in CSS.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top