CSS3_2D旋转案例

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            overflow: hidden;
            width: 200px;
            height: 200px;
            border: 1px solid #000;
            /* margin: 100px auto; */
            margin: 10px;
            float: left;
        }
        
        div::before {
            content: "人才";
            display: block;
            width: 100%;
            height: 100%;
            transform-origin: left bottom;
            transform: rotate(180deg);
            transition: all 0.4s;
            background-color: skyblue;
        }
        
        div:hover::before {
            transform: rotate(0deg);
        }
    </style>
</head>

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

</html>

猜你喜欢

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