CSS text Wrap properties Word-wrap and White-space

Source: Internet
Author: User
Today encountered TD text content does not wrap, found that: White-space:nowrap, that is, forced text does not wrap, by the way, the text wraps the property Word-wrap, summarized as follows:


The default for White-space is normal, which wraps itself.

Word-break:break-all and Word-wrap:break-word are forced to wrap, the former if the English characters too long automatic truncation, the latter the entire English word will wrap!

And I often use it this way:

Word-wrap:break-word; Overflow:hidden;

There is no problem with IE under FF, long strings of English will be obscured beyond the content

Td.th forced line wrapping method in table:

<table style= "table-layout:fixed" width= ">"
<tr>
<TD width= "25%" style= "Word-break:break-all; Overflow:hidden; ">php Point-to-point (www.phpddt.com) Original tutorial </td>
<TD width= "75%" style= "Word-wrap:break-word; Overflow:hidden; ">php Point-to-point (www.phpddt.com) Original tutorial </td>
</tr>
</table>

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.