效果图
代码
<!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>
*{
padding: 0;
margin: 0;
}
body{
margin: 300px auto;
width: 300px;
position: relative;
}
.menu-toggle {
width: 25px;
height: 25px;
background: #fff;
padding: 24px;
border-radius: 50%;
direction: rtl;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 10px 30px -14px #000;
cursor: pointer;
}
.menu-toggle span {
display: block;
width: 25px;
height: 2px;
background: #777;
border-radius: 2px;
transition: all 300ms ease;
}
.menu-toggle span:not(:last-child) {
margin-bottom: 5px;
}
.menu-toggle span:first-child {
width: 20px;
}
.menu-toggle span:last-child {
width: 15px;
}
.menu-toggle:hover span:first-child,
.menu-toggle:hover span:last-child {
width: 100%;
}
</style>
</head>
<body>
<div class="menu-toggle">
<div>
<span></span>
<span></span>
<span></span>
</div>
</div>
</body>
</html>