Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
¿Cómo puedo hacer que el texto desbordado se anime de izquierda a derecha?

El concepto es simple, cuando el texto es demasiado largo para el contenedor, se anima (desplaza) infinitamente de izquierda a derecha y repite este proceso una vez que llega al final.

¿Cómo debo hacer para hacer esto?

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body> <div class="auto-scroll"> <p> This text should scroll. Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi commodi magni quo officia error ab veniam aspernatur. Quos ducimus, hic, maxime dicta optio quidem nostrum sint commodi velit, ut distinctio. And return to beginning. </p> </div> <style> .auto-scroll { background: black; padding: 18px; } .auto-scroll p { font-family: monospace; font-size: 18px; color: white; margin: 0; white-space: nowrap; overflow: auto; } .auto-scroll ::-webkit-scrollbar { height: 10px; /* will be 0px */ } .auto-scroll ::-webkit-scrollbar-track { background: #000; } .auto-scroll ::-webkit-scrollbar-thumb { background: #fff; } </style> </body> </html>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No necesita javascript, puede hacerlo en css como este siguiente código

 div{ width: 100%; background-color: black; white-space: nowrap; overflow: hidden; box-sizing: border-box; } p{ display: inline-block; color: #FFF; padding-left: 100%; animation: move 25s linear infinite; } @keyframes move { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }
 <div> <p>This text should scroll. Lorem ipsum dolor sit amet consectetur adipisicing elit. Excepturi commodi magni quo officia error ab veniam aspernatur. Quos ducimus, hic, maxime dicta optio quidem nostrum sint commodi velit, ut distinctio. And return to beginning.</p> </div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!