want to change background of table td on hover
- by Brad
I have a webpage that displays a calendar, and I want to change the background-color of any td that has their day number linked, so when I hover over that day, it changes the background-color.
I thought this would work:
.main-calendar td {
width:14%;
height:100px;
text-align:center;
border:1px solid #000;
font-size:20px;
vertical-align:middle;
display:block;
}
table.main-calendar td a:hover,
table.main-calendar td a:visited {
display:block;
text-decoration:none;
background-color:red;
color:#fff;
}
table.main-calendar td a:link {
display:block;
text-decoration:none;
background-color:green;
color:#fff;
}
Any help is appreciated.