Mohsin_Kamal_Khan
Mohsin_Kamal_Khan
KPCKevin Powell - Community
Created by Mohsin_Kamal_Khan on 7/7/2024 in #front-end
transition property not working on a div with border-radius
.circle { color: white; width: 100px; height: 100px; /* border-radius: 50px; */ background-color: #ff7979; transition: transform 0.5s linear; } .circle.rotate { transform: rotate(-30deg); } I have a button that adds and removes rotate class from the circle div, I want the circle to animate the rotation when press the button. The circle is rotating fine with border-radius removed, but when added it just disappears from its previous position and appears at the new position like there is no transition property added to circle class. What am I getting wrong?
12 replies