zoukankan      html  css  js  c++  java
  • 文本溢出显示省略号

    <style type="text/css">
    .text { width:100px; overflow:hidden;}
    .text-cut{ 
        display:block;
        text-overflow: ellipsis;
        width:100%; /*ie6 写在一层的时候要用到*/
        white-space: nowrap;
    }
    </style>
    </head>
    
    <body>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    <h2 class="text"><span class="text-cut">我在哪里我的爱,为你不怕风吹日晒</span></h2>
    </body>

    注意:外层的overflow是必须的,width100%是为了兼容ie6,但在这个例子是中是不需要的,注意和下面的比较

  • 相关阅读:
    Oracle Flashback Table
    新上线MySQL数据库规划
    Spark启动流程(Standalone)- master源码
    Spark启动流程(Standalone)-分析
    Spark Netty 通信框架解析
    Spark内核概述
    SparkStreaming DStream转换
    Spark-Core RDD依赖关系
    Spark-Core RDD中函数(变量)传递
    Spark-Core RDD行动算子
  • 原文地址:https://www.cnblogs.com/wannasing/p/3077240.html
Copyright © 2011-2022 走看看