I have a banner image loading on my site with this code:
@keyframes animatedBanner {
from {
background-position-y: bottom;
}
to {
background-position-y: top;
}
}
.page-hero {
background-image: url(https://via.placeholder.com/428x100);
background-repeat: no-repeat;
padding-top: 214px;
padding-bottom: 214px;
text-align: center;
animation: 2s ease-out 0s 1 animatedBanner;
background-size: auto;
}
<div class="page-hero">
<div class="inside-page-hero grid-container grid-parent">
<h2>this is an image</h2>
</div>
</div>
This does what I hoped it would (slide the image up when the page loads). But the problem is that I was hoping to have the image span the entire width of the screen regardless of width. I tried using cover, but then the image doesn't scroll at all.
Is there a way to make this design responsive on the image?