How to change text color for link in tr element using CSS

I want to change the background color and text when the mouse hovers over a row in a table:

tr { background-color:#FFF; color:#000; } tr:hover { background-color:#000; color:#FFF; } 

This works if there are no links in the tr elements, but when there is, the link color remains black (due to a { color: #000; } ?). How to indicate in CSS that links in a tr element should change when the mouse hovers over tr ?

+6
html css
source share
2 answers

What about

 tr:hover a { color: #CC0000; } 

Is this what you are looking for?

+15
source share

Try

 tr a{ color:#000; } tr a:hover { color:#FFF; } 
+1
source share

All Articles