How can I set a rotation point for an element in CSS?

kugyousha picture kugyousha · Jul 11, 2011 · Viewed 40.2k times · Source

Is it possible to set the rotation point in CSS? The default rotation point is at the 50%, 50%. I tried:

transform: rotate(230deg); 
rotation-point:90% 90%;

But it does not work... Any suggestions?

Answer

Marco Allori picture Marco Allori · Nov 22, 2012

This will set the rotation pivot point on top-left corner of your element and rotate it:

transform: rotate(-25deg);
transform-origin: 0% 0%;

take a glance at .nav_item_txt class:

http://jsfiddle.net/KHkX7/