Animación hover sencilla para un botón
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.container{
display: flex;
height: 100vh;
width: 100%;
justify-content: center;
align-items: center;
}
button{
border: 0;
background-color: rgb(0, 204, 255);
padding: 20px 40px;
font-size: 2rem;
color: #fff;
border-radius: 10px;
transition: all 0.5s;
cursor: pointer;
}
button:hover{
animation: button-ani 1s;
transition: all 0.5s;
}
@keyframes button-ani{
0%{
transform: translateX(0px);
transition: all 0.5s;
}
100%{
transform: translateX(20px);
transition: all 0.5s;
}
}
</style>
</head>
<body>
<div class="container">
<div class="button-c">
<button>Animación</button>
</div>
</div>
</body>
</html>```
Curso de Frontend Developer
0 Comentarios
para escribir tu comentario