关闭按钮

1.我看到一个还可以的,写了一下

<style>
    body{
        background: black;
    }
    .close{
        width: 36px;
        height: 36px;
        position: relative;
        cursor: pointer;
    }
    .close:before,.close:after{
        content: '';
        width: 36px;
        height: 1;
        position: absolute;
        background: white;
        top: 15px;
        transition: all ease 0.4s;
    }
    .close:after{
       transform: rotate(45deg);
    }
    .close:before{
        transform: rotate(-45deg);
    }

    .close:hover:after,.close:hover:before{
        transform: rotate(0deg);
    }
</style>
<body>
   <div class="close">

   </div> 
</body>
原文地址:https://www.cnblogs.com/chenyi4/p/12451689.html