<!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>
body{
background: #000;
}
.box{
width: 100%;
height: 100%;
position: fixed;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.btn{
width: 200px;
height: 40px;
background: none;
border: 2px solid #fff;
position: relative;
color: #fff;
}
.btn::after{
content: '';
display: block;
width: 30px;
height: 10px;
border: 2px solid #fff;
position: absolute;
top: -7px;
background-color: #000;
left: 5px;
transition: 0.5s all;
}
.btn::before{
content: '';
display: block;
width: 30px;
height: 10px;
border: 2px solid #fff;
position: absolute;
bottom: -7px;
right: 5px;
background-color: #000;
transition: 0.5s all;
}
.btn:hover::before{
right: 80% !important;
}
.btn:hover::after{
left: 80% !important;
}
</style>
</head>
<body>
<div class="box">
<button class="btn">点击按钮</button>
</div>
</body>
</html>