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

150
Vistas
how do i create a contrail for a mouse with html

I'm trying to make a website in where a word "lean" follows your cursor. there are two issues i have that I'm struggling with. first: the <div id="circle">lean</div>(see html below) element only works when there is text above it. my second problem is that the word is stuck in the right corner and wont move.

here is my code:

let circle = document.getElementById('circle');

const onMouseMove = (e) => {
  circle.style.left = e.pageX + 'px';
  circle.style.top = e.pageY + 'px';
}

document.addEventListener('mousemove', onMouseMove);
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: white;
  color: #8A2BE2;
}

div {
  position: absolute;
  transform: translate(-50%, -50%);
  height: 35px;
  width: 35px;
}
a
<div id="circle">
  lean
</div>

is it possible that this has something to do with the version of the html files? i have largely created this html from a combination of other old tutorials. sorry if this is a dumb question, I'm still a novice programmer.

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