如何使文本溢出边界显示为省略号?

#test{width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  1. 首先需设置将文本强制在一行内显示,然后将溢出的文本通过overflow:hidden截断,并以text-overflow:ellipsis方式将截断的文本显示为省略号。

posted @ 2017-11-15 11:42  对三  阅读(440)  评论(0编辑  收藏  举报