가오리의 코딩일기
3D Flip Button 만들기 본문
https://www.youtube.com/playlist?list=PL-eeIUD86IjSyxTbGT7wY3Hie_HA5bKvg
<!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 Flip Button</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="flip-btn">
<div class="front">front</div>
<div class="back">back</div>
</div>
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: black;
}
.container {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
perspective: 1000px;
}
.flip-btn {
width: 200px;
height: 100px;
color: white;
text-align: center;
line-height: 100px;
transform-style: preserve-3d;
transition: 0.5s;
cursor: pointer;
}
.flip-btn:hover {
transform: rotateX(-90deg);
}
.front {
background-color: goldenrod;
height: 100px;
transform: translateZ(50px);
}
.back {
background-color: darkgoldenrod;
height: 100px;
transform: rotateX(90deg) translateZ(150px);
}
'HTML+CSS+JavaScript > 만들기' 카테고리의 다른 글
고스트 (0) | 2022.05.14 |
---|---|
HTML5와 CSS3를 사용해서 웹 페이지 하나 만들어보기 (0) | 2022.05.13 |
타이핑 효과 랜딩 페이지 만들기 (0) | 2022.05.10 |
calculator (0) | 2022.04.05 |
4. 메인 (0) | 2022.02.28 |