I am trying to get a full-width css3 animation which animates the background. This works fine as long as the height of the body stays at the viewport height. If the content changes and the user needs to scroll, the animation breaks at the bottom:
I already tried to change the css styles of html and body according to some tutorials and ended up with this:
I also tried to set body to 100vh but I think the problem is with the animation itself not scaling properly.
The css for the animation is this:
html {
height: 100%;
}
body {
min-height: 100%;
}
.rememberly-animation {
background: linear-gradient(41deg, #53b5fe, #7abfb4, #5e9793);
-webkit-animation: rememberly-background 30s ease infinite;
-moz-animation: rememberly-background 30s ease infinite;
animation: rememberly-background 30s ease infinite;
}
@-webkit-keyframes rememberly-background {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
@-moz-keyframes rememberly-background {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
@keyframes rememberly-background {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
<html>
<body class="rememberly-animation">
</body>
</html>
The class .rememberly-animation is added to the body-tag.
I somehow need the animation to scale the full height if the viewport (the content) is changing and the user needs to scroll down.
Any hints on this?