CSS 使用css旋转图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1526448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 21:08:17  来源:igfitidea点击:

Rotating an image using css

cssimagerotation

提问by DanDan

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?

我想通过四个方向以 90 度角旋转网页上的图像。我希望这发生在客户端机器上。这可以使用css来完成吗?或者我需要使用javascript吗?

Thank you for your time.

感谢您的时间。

采纳答案by Mark Bell

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.

您可以使用这些 CSS 转换在 Firefox 中完成此操作- 至于其他浏览器,我认为您需要 Javascript。我建议你也许看看Raphael library

回答by Paul

Afraid you're gonna have to use some javascript for that - CSS cannot do this currently

恐怕你将不得不为此使用一些 javascript - CSS 目前无法做到这一点

Try checking this out:

试试看这个:

http://code.google.com/p/jquery-rotate/

http://code.google.com/p/jquery-rotate/