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

138
Vistas
I have this `div` on my home page and want it to move with me when I scroll, I am using react for the website btw

I have this div on my home page and want it to move with me when I scroll: I tried using position:sticky; and position: fixed and adding top: 600px; but its not moving to the top its stuck at the bottom

.linkss {
  color: #8892b0;
  font-family: 'NTR', sans-serif;
  font-size: 25px;
  right: 10px;
  top: 680px;
  padding-right: 30px;
  position: fixed;
}

.linkss h3 {
  margin: 0px;
  height: 50px;
  color: #c9c1f5;
}

.linkss a {
  border: 0px;
  display: block;
  padding: 0px;
  margin: 0px;
  font-size: 23px;
  padding-left: 30px;
  color: #c9c1f5;
  height: 30px;
  width: 110px;
}
<div className="linkss">
  <h3>/ Links</h3>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ Etsy Shop </a>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ LinkedIn </a>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ Instagram </a>
</div>

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You need to use addEventListener in componentDidMount as below:

componentDidMount() {
  document.addEventListener('scroll', this.doSomething)
}

doSomething = () => {
  if (window.pageYOffset > 100) {
     // add a new class (with top: 0) to element or change style of element by top = 0
  } else {
    // do something else
  }
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

I think it's stuck to the bottom because you have given top:680px; decrease it to something smaller like 20px. And set the position property to position:sticky;

about 4 years ago · Juan Pablo Isaza 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