Reputation: 79
I am using MVC3. I have a table and an Html.ActionLink inside of it. I have already set the text decoration for none, but the link is still blue. I change the table:hover background-color and the color(of the text), and when I put the mouse over the row, the text that are not a link gets white, but the link still blue. If I change the a:hover, the link gets white just when I put the mouse over it, and not just over the row.
Is there a way to do that with css?
Upvotes: 0
Views: 1395
Reputation: 78971
Typically, to cover all the anchors when you are hovering over the row.
#tableid tr:hover a {
/* Your Styles */
}
But this does not work on all IE browser so, use JS to catch the event and apply styles to anchors in it.
Upvotes: 1
Reputation: 1370
use the following css:
#yourTableId:hover a {
color: #FFF;
}
you can replace #yourTableId
also with table and / or .yourTablesClass
depending on where the css should be used ;)
this works also for child elements e.g.:
#yourTableId div:hover a
#yourTableId tr:hover a
so in general we can say you can use the following:
#yourTableId *:hover a
where * is a tagname, classname or id (dont forget class and id prefixes -> .classname and #idname)
Upvotes: 1