2D转换综合写法顺序
<!DOCTYPE html>
<html lang="en">
<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: 200px;
height: 200px;
background-color: hotpink;
transition: all .5s;
}
div:hover {
/* 以下是先移动再旋转的效果,如果先旋转再移动,会改变坐标轴方向 */
/* transform: translate(50px, 50px) rotate(180deg); */
/* 当同时具有位移和其他属性时,要先写位移 */
transform: translate(50px, 50px) rotate(180deg) scale(1.2);
}
</style>
</head>
<body>
<div></div>
</body>
</html>