search

Home  >  Q&A  >  body text

css3文本如何控制首行空两格,然后只显示4行,多余的以...显示

css3如何控制首行空两格,然后只显示4行,多余的以...显示

PHP中文网PHP中文网2863 days ago468

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 11:50:01

    //首先缩进
    text-indent:2em;
    //只显示4行
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:50:01

    p{
        text-indent: 2rem;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    Only 4 lines are displayed: Boy, you are asking too much for CSS3!

    reply
    0
  • Cancelreply