HTML _CSS
3D BUTTON
HiroDaegu
2022. 5. 9. 00:33
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<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>3D BUTTON</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<button class="btn">Hover On Me</button>
</div>
</body>
</html>
*, *:after, *:before{
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
body{
font-size:100%;
padding:100px;
margin:0;
height:100%;
}
body{
font-family:Arial, sans-serif;
background:#000;
}
.container{
height:100%;
position:relative;
perspective:800px;
}
/* General button styles */
.btn{
border:none;
position:relative;
background:none;
padding:30px 80px;
display:inline-block;
text-transform:uppercase;
background:#cc0099;
color:#fff;
letter-spacing:2px;
font-size:1rem;
font-weight:800;
transform-style:preserve-3d;
outline:none;
outline:1px solid transparent;
transition:all 0.5s ease-out;
cursor:pointer;
}
.btn:after{
content:"Button";
position:absolute;
padding:30px 80px;
z-index:-1;
transition: all 0.5s ease-out;
width:100%;
height:100%;
left:0;
top:-100%;
background:#990073;
transform-origin:0% 100%;
transform:rotateX(90deg);
}
.btn:hover{
transform: translateY(40px) rotateX(-90deg);
}
728x90
LIST