Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
CSS gradients and -webkit-background-clip not allowing a transition

.nav-content a {
    color: #000;
    text-decoration: none;
    font-size: 1.1em;
    padding: 20px 40px 20px 40px;
    background-image: linear-gradient(90deg, #000, #000);
    -webkit-background-clip: text;
    font-family: 'Raleway', sans-serif;
    transition: .4s ease-in-out;
}
.nav-content a:hover {
    background-image: linear-gradient(90deg, #6E1D16, #E4DA1E, #D5347D, #15DAE7,#6E1D16, #E4DA1E, #D5347D, #15DAE7);
    -webkit-background-clip: text;
    color: rgba(0,0,0,.1);
    cursor: pointer;
}
<nav class="nav-content">

  <a>Home</a>
  <a>Contact</a>
  <a>About</a>
  
</nav>

So I am trying to get my "navbar" to do a transition-out, but it will only transition-in. I know that gradient transitions are not supported, but does anyone know how to do this? I am fine with a work around too.

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

The colors are only visible because they only exist while hovering. Just move your linear-gradient background to .nav-content a.

Also, always specify what property to animate (color) to avoid performance issues.

.nav-content a {
    color: #000;
    text-decoration: none;
    font-size: 1.1em;
    padding: 20px 40px 20px 40px;
    -webkit-background-clip: text;
    font-family: 'Raleway', sans-serif;
    transition: color .4s ease-in-out;

    background-image: linear-gradient(90deg, #6E1D16, #E4DA1E, #D5347D, #15DAE7,#6E1D16, #E4DA1E, #D5347D, #15DAE7);
}
.nav-content a:hover {
    -webkit-background-clip: text;
    color: rgba(0,0,0,.1);
    cursor: pointer;
}
<nav class="nav-content">

  <a>Home</a>
  <a>Contact</a>
  <a>About</a>
  
</nav>

about 4 years ago · Santiago Gelvez Denunciar

0

I know of this little hack to animate gradients, you can make them twice the size using background-size: 200% and set background-position: left top and transition to background-position: right bottom

.nav-content a {
  background-image: linear-gradient(
    90deg,
    black 50%, /* ADDED THIS */
    #6E1D16,
    #E4DA1E,
    #D5347D,
    #15DAE7,
    #6E1D16,
    #E4DA1E,
    #D5347D,
    #15DAE7
  );
  background-size: 200%;
  background-repeat: no-repeat;
  background-position: left top;

  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  color: #000;
  cursor: pointer;
  font: 1.1em 'Raleway', sans-serif;
  padding: 20px 40px 20px 40px;
  text-decoration: none;
  transition: background-position 1s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

.nav-content a:hover { background-position: right bottom }
<nav class="nav-content">
  <a>Home</a>
  <a>Contact</a>
  <a>About</a>
</nav>

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda