旋转卡片案例
旋转卡片案例
旋转卡片案例
* {
margin: 0;
padding: 0;
}
.box {
width: 200px;
height: 200px;
border: 6px solid pink;
margin: 100px;
}
img {
width: 200px;
height: 200px;
font-weight: 700;
color: #fff;
text-align: center;
line-height: 200px;
background-color: #ff6347;
/* 默认的转换中心 中心 transform-origin: center center; */
transform-origin: left bottom;
transform: rotate(90deg);
transition: all 3s;
}
.box:hover img {
/* 从初始旋转的90deg恢复成0deg */
transform: rotate(0deg);
}
<body>
<div class="box">
<img src="./img/1.png" alt="">
</div>
</body>
效果:
你真棒