div { transform: translate(10px, 10px); width: 100px; height: 100px; background: lightblue; display: inline-block; margin: 50px; } div.active { transform: translate(10px, 10px) scale(1.1); } div.active2 { transform: scale(1.1) translate(10px, 10px) rotate(45deg); }
<div></div> <div class="active"></div>
The transform property of your active class overwrites the original value.
You need to specify both in the active class.
Note : translate values ββrequire units
div { transform: translate(10px, 10px); } div.active { transform: translate(10px, 10px) scale(1.1); }
source share