样式表自动截断字符串、省略显示不出来的字符,不用服务器端处理,也不会出现乱码

<p style="line-height:21px; height:21px;text;overflow: hidden;text-overflow: ellipsis; 150px>这里有很多的字,浏览器会帮你自动省略,ie6就支持了</p>

诀窍是,必须设定合适的宽度和高度,text-overflow: ellipsis才会起到作用
原文地址:https://www.cnblogs.com/lein317/p/5067630.html