CSS3_2D转换综合写法

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2D转换综合写法</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: pink;
            transition: all .5s;
        }
        
        div:hover {
            /* transform: translate(150px, 150px) rotate(180deg); */
            transform: rotate(180deg) translate(150px, 150px);
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>
<!-- tips -->
<!-- 1.同时使用多个转换,其格式为transform:translate() rotate() scale().... -->
<!-- 2.其顺序会改变转换后的结果(先旋转会改变坐标方向) -->
<!-- 3.同时有位移和其他属性的时候,记得要将位移放到最前面 -->

猜你喜欢

转载自blog.csdn.net/weixin_44079801/article/details/106968195