I want to change the point of rotation of a div. How to do that?
Basically I want to create something like a disco lights. I have a triangle which i want to rotate but its rotational point should be fixed at the top. I tried transform-origin but that is not giving me the expected results. I have a code pen. Please let me know how this can be done.
https://codepen.io/kashyaprajan11/pen/xxaVbYw?editors=1100
6 Replies
I'm not at my PC atm but you need the deceleration on the element not the key frame?
Transform-origin on .light
transform-origin: 'top left';
needs quotes around the top left
?No quotes
haha, correct 😄
just checked
I'm out
😅 .. How can I do that. Thanks a lot 🙏
transform-origin - CSS: Cascading Style Sheets | MDN
The transform-origin CSS property sets the origin for an element's transformations.