如何创建倾斜(非水平)幻灯片?
有没有办法创建旋转 5° 的图像幻灯片?我更喜欢非闪存解决方案。谢谢你!
is there a way to create an image slideshow that is rotated by say 5° ? I'd prefer a non-flash solution. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CSS3 有一个可以设置的
rotate
属性。在您的样式表中,它看起来像这样:但是,它是相当新的,并且目前的浏览器支持相当有限,所以它并不理想。
某些浏览器使用供应商前缀支持它,这意味着它是实验性的,但您无论如何都可以将它们包含在样式表中。
Microsoft Internet Explorer 有完全不同的轮换机制。
您的最终样式表可能如下所示:(
您需要自己计算 IE 的角度!我提供的角度应该可以为 45 度)
但是,即使如此,您也无法确定用户的浏览器是否 正确会支持它,并且您可能还需要处理其他怪癖。
当然,由于屏幕上的像素化,旋转元素的质量也会下降。严重程度取决于浏览器旋转算法的质量,但总会有一些质量损失。
简而言之,浏览器中的旋转(至少目前如此)更多的是一种玩物,而不是一个有用的功能。但这是可以做到的。
CSS3 has a
rotate
property which you can set. In your stylesheet, it would look something like this:However, it's quite new and it's got fairly limited browser support at the moment, so it's not ideal.
Some browsers support it using vendor prefixes, which means it's experimental, but you could include them in your stylesheet anyway.
Microsoft Internet Explorer has a completely different mechanism for rotation.
Your final stylesheet might look something like this:
(You'll need to work out the angles yourself for IE! the one I've provided should be okay for 45 degrees)
However, even then you can't be certain that the user's browser will support it, and there may be other quirks you'd need to deal with.
Also, of course, a rotated element will be degraded in quality due to pixellisation on screen. How badly will depend on the quality of the browser's rotation algorithms, but there will always be some loss of quality.
In short, rotation in a browser (for the time being at least) is more of a play-thing than a useful piece of functionality. But it can be done.
您可以将其与 CSS 转换 一起使用,但它不适用于所有浏览器。
编辑: 这是一个旨在跨浏览器工作的解决方案。
You'll be able to use this with CSS transformations, but it won't work in all browsers.
Edit: Here's a solution that purports to work cross-browser.