Rotating an image using css

两盒软妹~` 提交于 2019-12-23 08:07:17

问题


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.


回答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.




回答2:


It is possible however only for new browsers.

Best Link I could find (Chrome / Safari / Firefox) with example

Sample source code (Safari/Chrome)

Sample source code (Firefox)

SO post containing code for IE Webkit and Firefox




回答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/



来源:https://stackoverflow.com/questions/1526448/rotating-an-image-using-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!