In your example, only the animation class :hoverhas animation. When the cursor leaves the first div, the freezing state immediately remains and no animation is specified. Animation must also be set in the classroom .two.
, , , CSS . transition.
:hover , div . :hover , div, div .
.two {
font-size: 0;
}
.two {
text-align: center;
transition: font-size 2.5s;
}
.one:hover + .two {
text-align: center;
font-size: 20px;
transition: font-size 0.5s;
}
<div class="one">
Hover
</div>
<div class="two">
Hello World!
</div>