TD or DIV text beyond the width of the CSS hide method

Source: Internet
Author: User

When we define the div width, inside the content may be more, will be super out, will div or form to support the big, deformation of the impact of the Web page beautiful, introduce a method, with CSS forced to hide unwanted content and automatically display ellipsis, such as the following HTML definition method:

In the above CSS code, text-overflow:ellipsis refers to an ellipsis mark (...) When the object text overflows, Text-overflow:clip is the default value, the ellipsis (...) is not displayed, but the extra content is trimmed off. However, also note that in CSS code:

Overflow:hidden;

Text-overflow:ellipsis;

White-space:nowrap;

These 3 definitions must be used together, be sure to set the width of the container, be sure to the table (or other containers) to define table-layout:fixed; only the layout algorithm defined table is fixed, the following TD definition can work!

Related Article

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.