多行文本溢出

来源:互联网 发布:java中的wait 编辑:程序博客网 时间:2024/04/30 00:51
<!DOCTYPE html>
<html>
<head>
    <title>Bootstrap 实例 - 标题</title>
   <META charset="utf-8">
  
   <script type="text/javascript" src="http://h5rsc.vipstatic.com/lefeng_pc/js/jquery/jquery.pack.js?20150916"></script>
   <style type="text/css">
   
 #demo4-one{
            width:150px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
}


#demo4-two{
            width:150px;
            display:-webkit-box !important;
            overflow:hidden;


            text-overflow: ellipsis;
            word-break: break-all;


            -webkit-box-orient: vertical;
            /*显示两行,如果显示3行再溢出则改写成 -webkit-line-clamp:3;*/
            -webkit-line-clamp:2;


        }


</style>


 
</head>
<body>
<div id="demo4-one">
        单行溢出,ddffffffffffffffffffff
</div>
   
<div id="demo4-two">
        多行文本溢出,多行文本溢出,多行文本溢出,多行文本溢出,多行文本溢出,多行文本溢出,
    </div>
</body>

</html>


兼容谷歌



0 0
原创粉丝点击