omega omega - 4 months ago 6
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;
}


Thanks

Answer

You should separate with a comma, like this:

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