Rotating an image using css
Solution 1
You can do it in Firefox using these CSS transforms - as for other browsers, I think you'll need Javascript. I'd recommend you perhaps take a look at the Raphael library.
Solution 2
It is possible however only for new browsers.
Best Link I could find (Chrome / Safari / Firefox) with example
Sample source code (Safari/Chrome)
SO post containing code for IE Webkit and Firefox
Solution 3
Afraid you're gonna have to use some javascript for that - CSS cannot do this currently
Try checking this out:
http://code.google.com/p/jquery-rotate/
DanDan
Visit my delicious website at WebBiscuit. Contact me at: [email protected] Find my writing on codeproject.
Updated on July 31, 2022Comments
-
DanDan almost 2 years
I'd like to rotate an image on a webpage through four orientations at 90 degrees apart. I'd prefer this to happen on the client machines. Can this be done using css? Or will I need to use javascript?
Thank you for your time.
-
DanDan over 14 yearsThank you for the links. Some interesting effects here! At the moment though, it looks like I will have use javascript until browsers catch up.
-
DanDan over 14 yearsThis looks like an excellent library and will save me a lot of work. Thank you for the link.