我想了解如何在悬停时制作旋转或旋转图像.我想知道如何在以下代码中使用 CSS 模拟该功能:
img {边界半径:50%;}
<img src="http://i.imgur.com/3DWAbmN.jpg"/>
上一页>
您可以使用 CSS3 过渡和 rotate()
来在悬停时旋转图像.
img {过渡:转换 .7s 缓进出;}图像:悬停{变换:旋转(360度);}
<img src="https://i.stack.imgur.com/BLkKe.jpg" width="100" height="100"/>
这是一个小提琴DEMO
更多信息和参考:
I want to find out how to make a spinning or rotating image when it is hovered. I would like to know how to emulate that functionality with CSS on the following code :
img {
border-radius: 50%;
}
<img src="http://i.imgur.com/3DWAbmN.jpg" />
You can use CSS3 transitions with rotate()
to spin the image on hover.
img {
transition: transform .7s ease-in-out;
}
img:hover {
transform: rotate(360deg);
}
<img src="https://i.stack.imgur.com/BLkKe.jpg" width="100" height="100"/>
Here is a fiddle DEMO
More info and references :
这篇关于悬停时旋转或旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!