[HTML/CSS] 简单的Menu图标

 

<!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>
</head>
<body>
    <style>
        .Menu {
            width: 18px;
            height: 12px;
            position: relative;
            cursor: pointer;
        }
        .Menu:before,
        .Menu:after {
            content: "";
            display: block;
            width: 18px;
            height: 2px;
            background: currentColor;
            border-radius: 8px;
            position: absolute;
            left: 0;
            transition: all ease-in 300ms;
        }
        .Menu:before {
            top: 0;
            box-shadow: 0 5px currentColor;
        }
        .Menu:after {
            bottom: 0;
        }
        .Menu:hover:before {
            top: 5px;
            box-shadow: none;
            -webkit-transform: rotate(225deg);
            transform: rotate(225deg);
        }
        .Menu:hover::after {
            bottom: 5px;
            -webkit-transform: rotate(135deg);
            transform: rotate(135deg);
        }
    </style>
    <div style="display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh;">
        <div class="Menu"></div>
    </div>
</body>
</html>

 

posted @ 2022-05-11 13:55  阳癫疯  阅读(59)  评论(0编辑  收藏  举报