1、单行截断
div{ text-overflow:ellipsis; -o-text-overflow:ellipsis; overflow:hidden; white-space:nowrap; -moz-white-space:nowrap; -o-white-space:nowrap; width:100px; border:1px solid #000; } <div>我们都是好孩子孩子孩子自知</div>
注:必须设置width
1、单行截断
div{ text-overflow:ellipsis; -o-text-overflow:ellipsis; overflow:hidden; white-space:nowrap; -moz-white-space:nowrap; -o-white-space:nowrap; width:100px; border:1px solid #000; } <div>我们都是好孩子孩子孩子自知</div>
注:必须设置width
转载于:https://www.cnblogs.com/dragonlong/p/4570464.html