<!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>
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
background-color: rgb(51, 51, 51);
}
.container {
text-align: center;
padding: 200px 0;
}
.btn {
background: none;
border: 0;
outline: none;
color: aquamarine;
font-family: 20px;
cursor: pointer;
border: 2px solid aquamarine;
width: 200px;
height: 50px;
position: relative;
}
.btn label {
position: absolute;
left: 0;
top: 0;
line-height: 50px;
width: 100%;
height: 100%;
z-index: 1;
background-color: rgb(51, 51, 51);
}
.btn::before {
content: '';
position: absolute;
left: -2px;
top: -2px;
width: 0;
height: 0;
background-color: brown;
z-index: 0;
transition: width .5s, height .5s;
}
.btn::after {
content: '';
position: absolute;
right: -2px;
bottom: -2px;
width: 0;
height: 0;
background-color: brown;
z-index: 0;
transition: width .5s, height .5s;
/* width: calc(100% + 4px);
height: calc(100% + 4px); */
}
.btn:hover::before {
width: calc(100% + 4px);
height: calc(100% + 4px);
}
.btn:hover::after {
width: calc(100% + 4px);
height: calc(100% + 4px);
}
.btn:hover {
color: brown;
}
</style>
</head>
<body>
<div class="container">
<button class="btn">
<label for="">Button</label>
</button>
</div>
</body>
</html>