I've been using the white-space: no-wrap, text-overflow: ellipsis, and overflow: hidden CSS properties to create ellipsis truncation for multiline text. However, this doesn't work when using flexbox.
When using flex, text-overflow: ellipsis seems to truncate the height of the flex-item to a single line always.
Is it possible to use some combination of flex and css ellipsis truncation for multiline text?
<div className="flex-container">
<div className="flex-item">
<p>long multiline text that i would like to truncate</p>
</div>
</div>
I can get it working with single line truncation. Setting the height manually in conjunction with flex + white-space: nowrap doesn't work.
text-overflow: ellipsis
to work, you must specifywhite-space: nowrap
. This, in effect, makes ellipsis on mult-line text impossible withtext-overflow
. That's why I referred you to the post above. It provides other methods for ellipsis on multi-line text. – Michael Benjamin