Answers for "how to affect a proprity for an element when hovering on other element"

0

how to affect a proprity for an element when hovering on other element

If the cube is directly inside the container:

#container:hover > #cube { background-color: yellow; }

If cube is next to (after containers closing tag) the container:

#container:hover + #cube { background-color: yellow; }

If the cube is somewhere inside the container:

#container:hover #cube { background-color: yellow; }

If the cube is a sibling of the container:

#container:hover ~ #cube { background-color: yellow; }
Posted by: Guest on May-04-2021

Code answers related to "how to affect a proprity for an element when hovering on other element"

Browse Popular Code Answers by Language