<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.box{
width: 200px;
height: 200px;
background-color: gold;
margin: 50px auto 0;
transition: all 1s ease;
}
.box:hover{
transform: translate(50px,50px);/*位移*/
}
.box:hover{
transform: rotate(360deg);/*旋转*/
}
.box3:hover{
transform: scale(0.5,0.2);/*缩放*/
}
.box4:hover{
transform: skew(0,45deg);/*斜切*/
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>人物</title>
<style type="text/css">
.box{
width: 120px;
height: 182px;
border: 1px solid #000;
margin: 50px auto 0;
overflow: hidden;
position: relative;
}
.box img{
position: absolute;
left: 0;
top: 0;
animation: walking 1s steps(8) infinite;
}
@keyframes walking{
from{
left: 0px;
}
to{
left: -960px;
}
}
</style>
</head>
<body>
<div class="box">
<img src="img/walking.png" alt="人物走路">
</div>
</body>
</html>