CSS实现文本超过指定长度显示省略号

 1 <style type="text/css"> 
 2 li { 
 3     width:200px;/*宽度,超过即会溢出*/ 
 4     line-height:25px;/*设置行间距*/ 
 5     text-overflow:ellipsis;/*当文本溢出时显示…此时还必须定义: 
 6     强制文本在一行内显示(white-space:nowrap)及溢出内容为隐藏            (overflow:hidden)*/ 
 7     white-space:nowrap;/*表示文本不会换行*/ 
 8     overflow:hidden;/*表示溢出的内容会被隐藏*/ 
 9 } 
10 </style>         
原文地址:https://www.cnblogs.com/sunshineground/p/4428840.html