效果:
代码:
<!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>学习</title>
<style>
body{
background-color: #000;
}
.button{
width: 100px;
height: 40px;
line-height: 38px;
text-align: center;
margin: 100px auto;
color: #0ebeff;
font-size: 14px;
background-color: #000;
border-radius: 10px;
position: relative;
z-index: 1;
overflow: hidden;
}
.button::before {
content: "";
position: absolute;
left: 50%;
top: 50%;
width: 200%;
height: 200%;
background-color: #0ebeff;
z-index: -2;
transform-origin: 0 0;
animation: rotate 3s infinite linear;
}
@keyframes rotate {
to{
transform: rotate(1turn);
}
}
.button::after {
content: "";
position: absolute;
width: calc(100% - 2px);
height: calc(100% - 2px);
top: 1px;
left: 1px;
background-color: #000;
z-index: -1;
border-radius: 10px;
}
</style>
</head>
<body>
<div class="button">边框按钮</div>
</body>
</html>