I have text, which is changed dynamically and I want to prevent it to be more than 3 lines for example (taking into account font-size
and line-height
properties).
Is it possible to achieve that in css only?
The use case is that I am using an external library, which sets the line-height of font, so I cannot calculate it dynamically in css.
Also I have tried 3em
, 6ex
, 4.5ch
, after this answer, and it did not work for me, because it does not take into account the line-height
property.
Example http://joxi.ru/48AnKxpiNXJgrO