Text overflow two lines to play ellipsis

Source: Internet
Author: User

Two lines-compatible under Google Browser:

HTML code <  class= "contxt-bulka-01">iphone 6,iphone 6S screen Protector teksonic [iphone 6 and iphone 6S iphone 6S iphone 6S]</p>CSS Code. CONTXT-BULKA-01 {    Display:- Webkit-box;    height:35px;    Word-break:break-all;    text-overflow:ellipsis;    -webkit-text-overflow:ellipsis;    Overflow:hidden;    -webkit-line-clamp:2;    -webkit-box-orient:vertical;    font-size:16px;}

Force a line ellipsis

#test {    text-overflow:ellipsis;    White-space:nowrap;    Overflow:hidden;    width:20px;} Text-overflow supports 2 values: Ellipsis is the default value for displaying ellipses and clip for clipping text. The function of White-space:nowrap is to not let the contents of the element be folded in a row and displayed on one line. The Overflow:hidden is hidden for overflow, with the aim of exceeding the element's wide height to no longer appear. width:20px; Sets the width of the element, which displays an ellipsis when the content exceeds that width.

Text overflow two lines to play ellipsis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.