CSS多行文字超出隐藏加省略号



<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">   
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>  
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />       
<title>CSS多行文字超出隐藏加省略号</title>
<style type="text/css">
html {height: 100%;}
body {width: 200px;height: 100%;position: relative;padding: 0;margin: 0;}
.m-super-msg-text{display: -webkit-box;max-height: 54px;line-height: 18px; font-size: 12px;text-align:justify;color: #838791;letter-spacing: 0;overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp: 3;-webkit-box-orient: vertical;word-break: break-all;}
</style>
</head>
<body>
<div class="m-super-msg-text">
超级大礼包,内含所有商品,半价优惠,经济实惠!超级大礼包,内含所有商品,半价优惠,经济实惠!超级大礼包,内含所有商品,半价优惠,经济实惠!
</div>
<script src="https://cdn.bootcss.com/jquery/1.9.0/jquery.js"></script>
<script>
</script>
</body>
</html>

posted @ 2018-07-06 11:52  徐同保  阅读(107)  评论(0编辑  收藏  举报