I want to zoom/unzoom a text with animate. The problem is that the text is absolutely positioned inside a relative div and when I animate the font-size the text expands only to the right and bottom. I want it to expand/retract to all sides equally.
Prepared example: http://jsbin.com/welcome/48103/edit
Animate using the CSS transition
property:
.zoom {
display: inline-block; /* this is needed for inline elements */
transition: transform 0.3s ease-in-out;
}
.zoom:hover {
transform: scale(1.4);
}
<a class="zoom" href='#'>Hover me!</a>
The align in horizontal center is easy. Just add text-align: center
and it will work. But if you want to align it in middle, you need to use display: table
, because "only" td is "allowed" to set vertical-align: middle
. So you have to build a div-table layout around: http://jsbin.com/welcome/48145/edit
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