omega omega - 1 year ago 52
CSS Question

how to define multiple classes' hover event in css?

In css how can I define multiple class' hover events to use the same properties.
This doesn't seem to work:

.my_div:hover .my_td:hover {
border: 1px solid red;


Answer Source

You should separate with a comma, like this:

.my_div:hover, .my_td:hover {
    border: 1px solid red;