效果图:
完整代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>悬停动画按钮</title>
<style>
body
{
margin: 0;
padding: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #ecf0f1;
}
.container
{
perspective: 320px;
}
.btn
{
display: block;
margin: 40px 0;
width: 240px;
height: 80px;