Apply CSS style to first table cell on row hover

css, hover

Solution

This should work:

#formTable tr:hover td:first-child {
   background:red;
}

:first-child: https://developer.mozilla.org/en-US/docs/CSS/:first-child

Problem

I have a table row with two cells. How can I make it so that when I hover the row, only the background of the first table cell changes color? ``` #formTable tr:hover { background:red; // only want the first cell to change... // ...this will do the whole row } ```

Original source