a very strange thing..
I want to change the text color and background color of the links when hovered.
this is the code
css:
#link-menu a
{
color:white;
display:block;
height:100%;
width: 100%;
text-decoration:none;
text-align:center;
line-height:45px;
font-weight:bold;
font-family:"trebuchet ms","comic sans ms";
outline:none;
}
.link2 a:hover
{
color:black;
background:white;
}
its not that the hover is not working. background color is changing but the text color is not changing.
one more imortant fact is that if instead of using the class .link2 , i use an id, color also changes. The issue is with using class only. Can somebody please explain the reason and the solution?
Note: i dont want to use the parent element id. because i dont want to change background of all links.