How can I make my table rows change color when hovered over without using Javascript? I tried using CSS with the following code:
tr:hover {
background: #000;
}
Unfortunately, this does not work as expected. While td:hover
changes the background color of individual cells, I want to highlight the entire table row.
Is there a way to achieve this effect using only CSS and HTML, or do I need to turn to Javascript for a solution?