Flex mode text overflow problem

Use flex layout, adaptive on the left, fixed on the right. As a
result, the text on the left is too long. The demand is to display a line, super long display...
I believe that the general cooking is
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
But the premise of this approach is to fix the width, such as width: 200px

The trouble is coming, now the left is adaptive, using width: calc (1-200px) does not work,
how to solve it:

Add max-width:calc (1-right width) to the parent layer element
and then add a width to itself: 100%
basically solves the problem

Guess you like

Origin blog.csdn.net/yujiayinshi/article/details/72631178