【发布时间】:2021-10-10 07:58:34
【问题描述】:
鉴于这两个电子邮件“Example@example.com”和“Blahblahblahblah@example.com”。在将它们都显示在表格中时,如果两封电子邮件都无法完全显示,那么它们将被完整地剪掉。所以“Example@example.com, Blahblahblahblah@ex...”应该被缩减为“Example@example.com, ...”
【问题讨论】:
标签: javascript css sass
鉴于这两个电子邮件“Example@example.com”和“Blahblahblahblah@example.com”。在将它们都显示在表格中时,如果两封电子邮件都无法完全显示,那么它们将被完整地剪掉。所以“Example@example.com, Blahblahblahblah@ex...”应该被缩减为“Example@example.com, ...”
【问题讨论】:
标签: javascript css sass
你正在寻找text-overflow: ellipsis:
div{
width:300px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit
</div>
【讨论】: