HTML:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body> <div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem est libero fugit placeat distinctio deserunt ipsam eveniet, odit officiis laudantium, quos, corporis saepe earum id quia unde impedit atque quod.
</div> </body>
</html>

CSS:

div {
width:400px;
overflow:hidden;
text-overflow: ellipsis;
word-break: break-all;/*一个单词为了换行好看,允许被拆开*/
-webkit-box-orient:vertical;
-webkit-line-clamp:;
display: -webkit-box; /*必须结合的属性 ,将对象作为弹性伸缩盒子模型显示 。*/
}

结果:

最新文章

  1. php知识案列分享
  2. cocos2d-x之 利用富文本控件解析xhml标签(文字标签,图片标签,换行标签,标签属性)
  3. 说说React
  4. 利用writing-mode实现元素的垂直居中
  5. MFC Edit控件 追加文本
  6. linux添加时间提示符
  7. -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
  8. 给Chrome和Firefox添加js脚本作为插件的方法
  9. js两个时间比较
  10. 线程间操作无效: 从不是创建控件&ldquo;textBox2&rdquo;的线程访问它
  11. [ES6] Array -- Destructuring and Rest Parameters &amp;&amp; for ..of &amp;&amp; Arrat.find()
  12. SQL Server -减少代码触发的负担
  13. 采用tcpdump攫Android网络数据包
  14. Python 项目实践二(生成数据)第一篇
  15. go基础系列:简介
  16. 【原创】python 豆瓣采集
  17. bitbucket迁移
  18. hadoop_spark伪分布式实验环境搭建和运行实例详细教程
  19. 使用ActivityGroup需要注意的地方
  20. Python中的垃圾回收机制

热门文章

  1. socket 连接关闭的TIME_WAIT状态的理由
  2. memcache_helper
  3. WebForm与MVC混用 (转)
  4. excle导出使用poi
  5. DRAM与SRAM
  6. POJ1059 Chutes and Ladders
  7. POJ3368
  8. ajax加载菊花loading效果
  9. Oracle trunc函数使用
  10. hive export import