<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2D旋转变换动画</title>
<style>
div {
width: 300px;
height: 300px;
background-color: aqua;
margin: 100px auto;
overflow: hidden;
}
div::after {
display: block;
box-sizing: border-box;
content: '哈喽';
width: 100%;
height: 100%;
background-color: pink;
text-align: center;
padding-top: 125px;
transform-origin: bottom left;
transform: rotate(90deg);
transition: transform 0.5s;
color: #fff;
font-size: 50px;
}
div:hover::after {
transform: rotate(0);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
【案例】2D变换-旋转动画
最新推荐文章于 2024-08-12 22:06:26 发布