Answers for "display and button when hover over another div"

CSS
13

hover on one div affect another

//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

make action on hover on other element

#container {
  width: 200px;
  height: 30px;
  border: 1px solid var(--c);
  --c:red;
}
#container:hover {
  --c:blue;
}
#container > div {
  width: 30px;
  height: 100%;
  background-color: var(--c);
}
Posted by: Guest on January-17-2021

Code answers related to "display and button when hover over another div"

Browse Popular Code Answers by Language