I am trying to create an image slider with texts and a button that slide up. However, I want each element to appear with a delay, but it's not working as expected. Currently, all elements load at once before the animation starts.
To view my code, click here.
@keyframes slide-up {
from {
padding-top: 100px;
opacity: 0;
}
to {
padding-top: 0;
opacity: 1;
}
.slide-heading {
font-size: 50px;
font-weight: 900;
margin: 0 0 30px 0;
width: 50%;
animation: slide-up 1s;
animation-iteration-count: 1;
animation-delay: 1s;
}
.slide-text {
line-height: 1.75;
font-size: 13px;
font-weight: 300;
width: 50%;
margin: 0 0 60px 0;
animation: slide-up 1s;
animation-iteration-count: 1;
animation-delay: 2s;
}
.slide-btn {
animation: slide-up 1s;
animation-iteration-count: 1;
animation-delay: 3s;
}
}
<div class="slide-heading">Lorem Ipsum </div>
<div class="slide-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas venenatis est metus, ac viverra quam rutrum vitae. Phasellus eget egestas arcu. Nulla porttitor at justo egestas ornare. </div>
<div class="slide-btn"><button class="btn btn-primary" type="submit">More</button></div>