Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
CSS gradient background animation is not animating

So I saw this same code here used on backgrounds as an answer so I modified it for me. Whenever I try it or any animation it's not working. Even a simple animation. I am not a professional, but here is the code. Any thoughts?

Also a link to the "live site" in case something else is overwriting it. Open Live Link: https://enthusiastic-dust.localsite.io

If prompted, enter the information below. Username: trampoline Password: unbiased

.gb-layout-hero-1 {
    background: rgba(74,32,80,1);/* Old Browsers */
    background: -moz-linear-gradient(45deg, rgba(74,32,80,1) 0%, rgba(17,34,37,255) 100%); /* FF3.6+ */
    background: -webkit-gradient(left bottom, right top, color-stop(0%, rgba(17,34,37,255)), color-stop(100%, rgba(34,99,104,1)));/* Chrome, Safari4+ */
    background: -webkit-linear-gradient(45deg, rgba(74,32,80,1) 0%, rgba(17,34,37,255) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(45deg, rgba(74,32,80,1) 0%, rgba(17,34,37,255) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(45deg, rgba(74,32,80,1) 0%, rgba(17,34,37,255) 100%); /* IE 10+ */
    background: linear-gradient(45deg, rgba(74,32,80,1) 0%, rgba(17,34,37,255) 100%);/* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4a2050', endColorstr='#226368', GradientType=1 );
    animation: gradient 16s linear infinite;
    animation-direction: alternate;
}
@keyframes gradient {
    0% {background-position: 0%}
    100% {background-position: 100%}
}

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your code is actually working, just not the way you intended it to do so. The gradient is being animated, the only issue is that it is not moving since you have not set a background-size larger than 100%, therefore the positions you alternate between are the same in this case.

If you declare background-size like below, your gradient background will be animated.

.gb-layout-hero-1 {
    background: linear-gradient(45deg, rgba(9,9,121,1) 25%, rgba(0,212,255,1) 30%);
    background-size: 150%;
    animation: gradient 1300ms linear infinite;
    animation-direction: alternate;
}
@keyframes gradient {
    0% {background-position: 0%}
    100% {background-position: 130%}
}
<div class="gb-layout-hero-1" style="width: 1000%; height:200px;"></div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda