Answers for "hover on parent and trasition on child element"

CSS
5

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 apply a transition to a child element when hovering over parent element

.parent {
    background: red;
}
.child {
    overflow: hidden;
    height: 0;
    background: blue;
    -webkit-transition: all .8s ease;
    -moz-transition: all .8s ease;
    -ms-transition: all .8s ease;
    -o-transition: all .8s ease;
    transition: all .8s ease;
    color: white;
}
.parent:hover > .child {
    height: 30px;
    display: block;
}
Posted by: Guest on May-08-2020

Code answers related to "hover on parent and trasition on child element"

Browse Popular Code Answers by Language