CSS style text overflow display ellipsis

Source: Internet
Author: User

Originally thought that the text overflow processing is more complex, did not expect such a simple sentence to take care of, CSS is really magical:

. li {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

Now learn to want to understand the meaning of each specific attribute, in the mind, can be written out in the future.

The following properties are checked:

White-space:nowrap; Indicates that the text will not wrap, continue on the same line, until the <br> tag is encountered;

Overflow:hidden; do not display more than the object size of the content, is to put out the part of the hidden;

Text-overflow:ellipsis; When the text object overflow is displayed ... and of course, the Set property is not displayed for clip point points;

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.