文本省略号

文本省略号,定制化的,不太通用

每次都要写一遍相似的,因此先把代码存在这里,留着之后用bash

.ellipsis {
    position: relative;
    line-height: 1.5;
    overflow: hidden;
    max-height: 37px;
  }
  .ellipsis::before {
    content: "...";
    position: absolute;
    z-index: 1;
    bottom: 0;
    right: 0;
    width: 26px;
    padding-left: 10px;
    box-sizing: border-box;
    background-color: white;
  }
  .ellipsis::after {
    content: "";
    display: inline-block;
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    background-color: white;
  }
复制代码
相关文章
相关标签/搜索