The use of text-overflow:clip|ellipsis in CSS

Source: Internet
Author: User

If you want to have a container (div or Li or ... Block-level elements) display a line of text, when the text content is too large, do not wrap, but appear ..., you can use the Text-overflow:clip|ellipsis basic syntax: Text-overflow:clip |  Ellipsis if the default value is Text-overflow:clip, the ellipsis (...) is not displayed, but the simple Cero is text-overflow:ellipsis the ellipsis (...) is displayed when the text inside the object overflows. For example:
<!doctype html>

Note: Overflow:hidden; Text-overflow:ellipsis;white-space:nowrap; Be sure to use it together.

1. Be sure to define a width for the container.

2. If the Overflow:hidden is missing, the text will stand laterally to the outside of the easy

3. If the white-space:nowrap is missing, the text will hold the height of the container down, even if you define the height, the ellipsis will not appear, the extra text will be cut off

4. If Text-overflow:ellipsis is missing, the extra text will be cut off, which is the equivalent of defining Text-overflow:clip.

The use of text-overflow:clip|ellipsis in CSS

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.