Answers for "how to select child when hover on parent element css"

CSS
3

how to select child when hover on parent element css

/* Selecting a child element on :hover parent element*/ 
.parent:hover .child {
   /* ... */
}
Posted by: Guest on September-22-2020
0

how to select child when hover on parent element css

<!DOCTYPE html>
<html>
<head>
<style>
.parent{
  width: 500px;
  height: 100px;
  background-color: red;
  cursor:pointer;
}

.parent:hover > .child{
 animation-name: example;
 animation-duration: 1s;
 animation-timing-function: ease;
}
@keyframes example {
  0% {margin-left:0px; color:white;}
  50%{margin-left:200px;}
}
</style>
</head>
<body>

<div class="parent">
	<h3 class="child">hello js</h3>
</div>

</body>
</html>
Posted by: Guest on May-30-2021

Code answers related to "how to select child when hover on parent element css"

Browse Popular Code Answers by Language