举个例子
//html
<div class="flex">
<div class="label">label</div>
<div class="content">
<div class="value">111112212212112111112212212112111112212212112111112212212112111112212212112111112212212112111112212212112111112212212112111112212212112111112212212112</div>
</div>
//css
.flex{
display: flex;
}
.value{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
这样无法超出省略,
但是可以在content加入overflow: hidden;或者min-width: 0;
.content{
overflow: hidden;
min-width: 0;
}
就可以使.value超出后省略