zoukankan      html  css  js  c++  java
  • CSS文字超出部分显示省略号、多行超出部分显示省略符 多行文本溢出

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
        </head>    
        <body>
            <style type="text/css">
            /*单行==所有浏览器*/
            #test{
            width:150px;height:20px;line-height:20px;
            text-overflow:ellipsis;white-space:nowrap;overflow:hidden;
            }
            /*多行==高版本浏览器和手机端可以用*/
            #test2{
            width:150px;line-height:20px;/*height:60px;*/
            display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow: hidden;
            
            }
            </style>
            <div id="test">小虾奋斗起来吧加油加油加油加油加油加油</div> <br /><br /><br />
            <div id="test2">小虾奋斗起来吧加油加油加油加油加油加油小虾奋斗起来吧加油加油加油加油加油加油小虾奋斗起来吧加油加油加油加油加油加油</div>
        </body>
    </html>
  • 相关阅读:
    ACM 一种排序
    ACM Binary String Matching
    ACM 括号配对问题
    ACM BUYING FEED
    ACM 喷水装置(二)
    ACM 会场安排问题
    ACM 推桌子
    ACM 心急的C小加
    ACM 田忌赛马
    ACM 疯牛
  • 原文地址:https://www.cnblogs.com/lidongfeng/p/4894930.html
Copyright © 2011-2022 走看看