Skip to content Skip to sidebar Skip to footer

How To Continue Css Animation On :hover After Mouse Leave The Element?

There is example of animation: .b-ball_bounce {transform-origin: top;} @-webkit-keyframes ball_animation { 20% {transform: rotate(-9deg);} 40% {transform: rotate(6deg);}

Solution 1:

You can do a lot of stuff with transition:

#some-div {
    background-color: rgba(100,100,0,0.2);
    transition: background-color 0.5s ease;
}
#some-div:hover { background-color: rgba(100,0,0,0.7); }

Look at the JSfiddle or look here for more

Solution 2:

CSS might help in some cases but not all, below is the code that will animate letter spacing on both hover and after hover.

h1
{
    -webkit-transition:all 0.3s ease;
}

h1:hover
{
    -webkit-transition:all 0.3s ease;
    letter-spacing:3px;
}
<body><h1>Hello</h1></body>

Post a Comment for "How To Continue Css Animation On :hover After Mouse Leave The Element?"