zoukankan      html  css  js  c++  java
  • css文本超出省略

    一、单行

    <div class="div">这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文</div>
    .div {
      background-color: green;
       100px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    二、多行

      1、私有属性

    <div class="div">这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文</div>
    .div {
      background-color: green;
       100px;
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
    }

      2、:before和:after

    <div class="div">这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文这是一段中文</div>
    .div {
      background-color: green;
       100px;
      height: 63px;
      position: relative;
      overflow: hidden;
      text-align: justify;
    }
    
    .div:before {
      content: "...";
      background-color: green;
       18px;
      height: 21px;
      position: absolute;
      right: 0;
      bottom: 0;
    }
    
    .div:after {
      content: "";
      background-color: green;
       18px;
      height: 63px;
      position: absolute;
      right: 0;
    }
  • 相关阅读:
    【ZJOI2017】树状数组
    【ZJOI2014】力
    【WC2017】挑战
    kube event 事件监控
    k8s nginx-ingress 504 timeout
    k8s 工具集
    jvm 性能调优工具之 jmap
    Elasticsearch unassigned 故障排查
    harbor API 与tag 清理
    前后端分离文档
  • 原文地址:https://www.cnblogs.com/linding/p/13278656.html
Copyright © 2011-2022 走看看