zoukankan      html  css  js  c++  java
  • CSS控制文字,超出部分显示省略号

    单行
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
    多行
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; //3行
    overflow: hidden;
     
    p{position: relative; line-height: 20px; max-height: 40px;overflow: hidden;}
    p::after{content: "..."; position: absolute; bottom: 0; right: 0; padding-left: 40px;
    background: -webkit-linear-gradient(left, transparent, #fff 55%);
    background: -o-linear-gradient(right, transparent, #fff 55%);
    background: -moz-linear-gradient(right, transparent, #fff 55%);
    background: linear-gradient(to right, transparent, #fff 55%);}
  • 相关阅读:
    Rotate List
    Spiral Matrix II
    Jump Game
    Maximum Subarray
    Pow(x, n)
    Anagrams
    Permutations
    unity 相机的问题
    NGUI 学习
    空间数据库1
  • 原文地址:https://www.cnblogs.com/teoh/p/11977329.html
Copyright © 2011-2022 走看看