want to change background of table td on hover
Posted
by Brad
on Stack Overflow
See other posts from Stack Overflow
or by Brad
Published on 2010-04-14T15:26:18Z
Indexed on
2010/04/14
15:33 UTC
Read the original article
Hit count: 292
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.
© Stack Overflow or respective owner