css 實現標籤內容多行截取(...)

來源:互聯網
上載者:User

css實現單行截取字串比較簡單,css屬性:overflow:hidden;white-space:nowrap;

想要實現多行截取,經過百度得到,取兩行然後截取的屬性;

overflow:hidden;

display:-webkit-box;

-webkit-line-clamp:2;

text-overflow:ellipsis;

-webkit-box-orient;vertical; o 解決問題;



overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; /* white-space: nowrap; */ text-overflow: ellipsis; -webkit-box-orient: vertical;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.