核心提示:CSS多行文字超出隐藏加省略号效果的代码实现!DOCTYPE htmlhtml headmeta charset=UTF-8 meta http-equiv=X-UA-Compatible conte...
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> <p class="m-super-msg-text"> 超级大礼包,内含所有商品,半价优惠,经济实惠!超级大礼包,内含所有商品,半价优惠,经济实惠!超级大礼包,内含所有商品,半价优惠,经济实惠! </p> <script src="https://cdn.bootcss.com/jquery/1.9.0/jquery.js"></script> <script> </script> </body> </html>