Answers for "how to target inner element using hover css"

CSS
7

when hover target diffrent element

//cube is directly inside the container:
#container:hover > #cube { background-color: yellow; }

//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 July-19-2020
0

hove over html element

$( "td" ).hover(
  function() {
    $( this ).addClass( "hover" );
  }, function() {
    $( this ).removeClass( "hover" );
  }
);
Posted by: Guest on September-28-2021

Code answers related to "how to target inner element using hover css"

Browse Popular Code Answers by Language