Reputation: 53
I am facing to some kind of weird problem, which occurs after scaling down the element.
div{
padding: 60px;
margin:100px;
background-color:red;
transition:1s;
}
div:hover {
transform:scale(1.2);
}
<div>abc</div>
Have you ever met with something like this? Does it occur because of some performance issue?
Thanks.
Upvotes: 2
Views: 639
Reputation: 272608
Use a 3D transformation instead:
div{
padding: 60px;
margin:100px;
background-color:red;
transition:1s;
transform:perspective(100px) translateZ(0);
}
div:hover {
transform:perspective(100px) translateZ(10px);
}
<div>abc</div>
Upvotes: 1