<div class="content">
<img src="./不确定1.png" />
</div>
<script>
</script>
<style>
.content>img {
transition: all 1s linear;
}
.content>img:hover {
transform: rotate(180deg);
}
</style>
本文介绍了一种使用CSS实现图片旋转的方法。通过定义样式并在鼠标悬停时触发旋转动画,可以为网站增加有趣的交互元素。本文将详细解释如何设置CSS代码来达到预期的效果。
<div class="content">
<img src="./不确定1.png" />
</div>
<script>
</script>
<style>
.content>img {
transition: all 1s linear;
}
.content>img:hover {
transform: rotate(180deg);
}
</style>
1万+

被折叠的 条评论
为什么被折叠?