css实现substr

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"type="text/javascript"></script>
<title>测试css截断</title>
<style type="text/css">
#append{
width: 100%;
display:-webkit-box !importmort;
overflow:hidden;
text-overflow:ellipsis;
word-break:break-all;
white-space:nowrap;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
</style>
</head>
<body>
<div style="width: 150px;">
<div id="append">春江潮水连海平,海上明月共潮生。</div>
</div>

<script type="text/javascript">

// $()
</script>
</body>
</html>

posted @ 2017-03-23 16:44  琰茜  阅读(115)  评论(0编辑  收藏  举报