0
I’m doing a side sidNav, I was able to animate it but the effect that the animation makes goes away, when the animation ends, I wanted to know why this is happening
My code
<!DOCTYPE html>
<html>
<head>
<title>Sid nav</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<nav>
<ul class="nav">
<li><a href="">Home</a></li>
<li><a href="">Contato</a></li>
<li><a href="">Sobre</a></li>
</ul>
</nav>
</body>
</html>
My css
*{
margin:0;
padding: 0;
}
.nav{
list-style-type: none;
display: flex;
flex-direction: column;
width: 20%;
text-align: center;
transform: translateX(-300px);
z-index: 1;
animation: animaSidNav 1s 1;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, .4);
}
.nav li
{
border: 1px solid #f1f1f1;
}
.nav li a{
text-decoration: none;
padding: 10px 20px;
display: block;
color: #fff;
}
@keyframes animaSidNav{
100%{
transform: translateX(0);
}
}