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

169
Views
Mostrar las dos últimas líneas de un texto grande en un div

Tengo texto continuo agregado a un div , quiero mostrar solo las dos últimas líneas del texto en el div que tiene un ancho fijo. Podría dividir el texto grande en varias líneas y luego mostrar las dos últimas líneas en el div, pero estaba comprobando si hay alguna propiedad css lista para usar en div que pueda mostrar automáticamente solo las últimas dos líneas y ocultar el resto.

Ejemplo:

 A printing press is a mechanical device for applying pressure to an inked surface resting upon a print medium (such as paper or cloth), thereby transferring the ink.

solo mostrar:

 upon a print medium (such as paper or cloth), thereby transferring the ink.
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes probar como a continuación:

 .box { width: 280px; line-height: 1.2em; height: 2.4em; /* twice the line-height */ overflow: hidden; display: flex; align-items: end; /* align at the end to see the last lines */ } .box p { margin: 0; }
 <div class="box"> <p> A printing press is a mechanical device for applying pressure to an inked surface resting upon a print medium (such as paper or cloth), thereby transferring the ink. </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!