“Comment sélectionner l'enfant lorsqu'il oscille sur l'élément parent CSS” Réponses codées

Comment sélectionner l'enfant lorsqu'il oscille sur l'élément parent CSS

/* Selecting a child element on :hover parent element*/ 
.parent:hover .child {
   /* ... */
}
deejay

Comment sélectionner l'enfant lorsqu'il oscille sur l'élément parent 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>
Outlander

Réponses similaires à “Comment sélectionner l'enfant lorsqu'il oscille sur l'élément parent CSS”

Questions similaires à “Comment sélectionner l'enfant lorsqu'il oscille sur l'élément parent CSS”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code