【CSS】Techniques for implementing gradient animation on the background/Implement gradation animation on the background | Demo page

※Please check using Developer tools

Dummy Text

Commentary

Sponsored links

CSS

.block {
  position: relative;
  height: 700px;
  background: linear-gradient(90deg, #ffebeb, #daf0ff, #fdf7e4);
  background-size: 250% 250%;
  animation: grad 4s ease infinite;
}
.block p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  font-size: 50px;
}
@keyframes grad {
  0% { background-position:0% 50% }
  50%{background-position:100% 50% }
  100%{background-position:0% 50%}
}
@media screen and (max-width:640px){
  .block {
    width: 100%;
  }
}