将多余的文字隐藏,并提示...来表示后面还有文字
2020-06-30 本文已影响0人
斯空拂
可用三行代码将多余文字隐藏,但又让人知道后面还有文字的效果。
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
如下图红色框内:

效果图如下红色框内:

可用三行代码将多余文字隐藏,但又让人知道后面还有文字的效果。
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
如下图红色框内:
效果图如下红色框内: