Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

98
Vistas
How to have ellipsis, clamp lines, and have text after ellipsis?

To display movie titles, I would like to have ellipsis, clamp the total number of lines to two, and have the year of the movie behind the ellipsis, such that a movie title like

Eternal Sunshine of the Spotless Mind (2004)

would be displayed like

Eternal Sunshine of
the Spotl... (2004)

when the width is restricted.

This would be straight-forward if it were one line, but I want two.

I have looked around on Stack Overflow, but I couldn't find any way to achieve all three of these. I would prefer a pure CSS solution, as using JavaScript for this seems finicky, but if that's not possible I guess I don't really have a choice.

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos