transform-origin元素

transform-origin是用来修改旋转角度的
transform-origin:(水平 垂直);
例如:
transform-origin:(left top);
就是说左上角旋转
<!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>Document</title>
    <style>
        .dim{
            margin: auto;
            width: 300px;
            height: 300px;

            background-image: url(../images/风车.png);
            background-repeat: no-repeat;
            background-size: 100% 100%;
            transition: all 0.9s;
            transform-origin: bottom;
            }

            .dim:hover{
                transform: rotate(200deg);
            }
    </style>
</head>
<body>
    <div class="dim">

    </div>

    
</body>
</html>

您可能还喜欢...