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
The :hover CSS pseudo-class matches when the user interacts with an element with a pointing device, but does not necessarily activate it. It is generally triggered when the user hovers over an element with the cursor (mouse pointer).
HTML elements can be assigned multiple classes by listing the classes in the class attribute, with a blank space to separate them.
To display div element using CSS on hover a tag: First, set the div element invisible i.e display:none;. By using the adjacent sibling selector and hover on a tag to display the div element.
You should separate with a comma, like this:
.my_div:hover, .my_td:hover { border: 1px solid red; } .contact-dpd:hover .contact-content, .work-dpd:hover .work-content{ display:block }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With