비전공자 개발일기

Pulse effect on button hover 본문

HTML _CSS

Pulse effect on button hover

HiroDaegu 2023. 2. 6. 19:17
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>PULSE EFFECT ON BUTTON HOVER</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <a href="#" class="btn">Hover me</a>
</body>

</html>

 

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #151515;
}

.btn {
  font-family: sans-serif;
	font-weight: 700;
	background-color: #FFF;
	color: #151515;
}

.btn:link,
.btn:visited {
	text-transform: uppercase;
	text-decoration: none;
	padding: 15px 40px;
	display: inline-block;
	border-radius: 100px;
	transition: all 0.2s;
	position: absolute;
}

.btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
	transform: translateY(-1px);
	box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn::after {
	content: "";
	display: inline-block;
	height: 100%;
	width: 100%;
	border-radius: 100px;
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
	transition: all 0.4s;
	background-color: #FFF;
}

.btn:hover::after {
	transform: scaleX(1.4) scaleY(1.6);
	opacity: 0;
}

@keyframes moveInBottom {
	0% {
		opacity: 0;
		transform: translateY(30px);
	}

	100% {
		opacity: 1;
		transform: translateY(0px);
	}
}

 

728x90
LIST

'HTML _CSS' 카테고리의 다른 글

Send Button Animation  (0) 2023.02.08
Bouncing Ball  (0) 2023.02.07
Cocacola  (0) 2023.02.05
Movie Streaming Website  (0) 2023.02.04
Animated Gender Selection Page Design  (0) 2023.02.02