I'm trying to reduce the size of the font gradually. But it looks like it shakes while turning small. How to make it look smooth?
.name:hover {
color: green;
transition-property: font-size;
transition-duration: 2s;
transition-timing-function: ease;
font-size: 5px;
}
<div class="name">Name</div>
Use a transform:scale
instead:
.name {
transition: transform 2s;
transform-origin: left
}
.name:hover {
color: green;
transform: scale(0.5);
}
<div class="name">Name</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With