728x90
출처 : 유튜브 DarkCode - Button With Awesome Hover Effects Using HTML & CSS
https://www.youtube.com/watch?v=SP0wAmjbaQ4
Hover시 움직이는 효과를 가진 버튼입니다.
html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="day3_button_Animation.css">
<title>Day3</title>
</head>
<body>
<button class="btn">
Hover Me
</button>
</body>
</html>
css
@charset "utf-8";
*{
margin: 0;
padding: 0;
}
body{
background: #353b48;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.btn{
width: 200px;
height: 60px;
background: none;
border: 4px solid;
color: #3498db;
font-weight: bold;
text-transform: uppercase;
cursor: pointer;
font-size: 16px;
position: relative;
}
.btn::before, .btn::after{
content: "";
position: absolute;
width: 14px;
height: 4px;
background: #353b48;
transform: skewX(50deg);
transition: .4s linear;
}
.btn::before{
top: -4px;
left: 10%;
}
.btn::after{
bottom: -4px;
right: 10%;
}
.btn:hover::before{
left: 80%;
}
.btn:hover::after{
right: 80%;
}
728x90
'HMTL & CSS' 카테고리의 다른 글
fixed layout / 따라오는 메뉴 (0) | 2020.08.19 |
---|---|
레이아웃 - 2단 레이아웃 ( layout ) (0) | 2020.08.19 |
레이아웃 - 1단 레이아웃 ( layout ) (0) | 2020.08.19 |
reset.css 에 대한 설명 및 예제 (0) | 2020.08.18 |
Loding Animation Html / Css 코드 (0) | 2020.03.19 |