Css force line feed IE and firefox line feed

Source: Internet
Author: User
Tags arabic numbers

For div, p, and other block-level elements, the normal text line feed (Asian text and non-Asian text) element has the default white-space: normal. The line feed is automatically generated after the defined width: html <div id = "wrap"> normal text wrapping (Asian text and non-Asian text) elements have the default white-space: normal, when </div> css # wrap {white-space: normal; width: 200px;} 1. (IE browser) continuous English characters and Arabic numbers, use word-wrap: break-word; or word-break: break-all; implement forced line break # wrap {word-break: break-all; width: 200px;} Or # wrap {word-wrap: break-word; width: 200px;} <div id = "wrap"> abcdefghijklmnabcdefghijklmn Abcdefghijklmn111111111 </div>: line feed is supported. (Firefox) continuous disconnection of English characters and Arabic numbers. All Firefox versions do not solve this problem. We only need to hide characters that exceed the boundary or, add a scroll bar # wrap {word-break: break-all; width: 200px; overflow: auto;} <div id = "wrap"> abcdefghijklmnabcdefghijklmnabcdefghijklmn1111111 </div> effect: the container is normal and the content is hidden in table 1. (IE browser) Use table-layout: fixed; to force the width of the table and hide unnecessary content <table style = "table-layout: fixed "width =" 200 "> <tr> <td> abcdefghigklmnopqrstuvwx Yz1234567890ssssssssssssss </td> </tr> </table> effect: Hide excess content 2. (IE browser) Use table-layout: fixed; to force the width of the table, use word-break: break-all in the td and th layers, or use word-wrap: break-word; wrap <table width = "200" style = "table-layout: fixed;"> <tr> <td width = "25%" style = "word-break: break-all; "> abcdefghigklmnopqrstuvwxyz 1234567890 </td> <td style =" word-wrap: break-word; "> abcdefghigklmnopqrstuvwxyz 1234567890 </td> </tr> </tabl E> effect: line feed is supported. (IE browser) nest div and p in td and th using the div mentioned above, and wrap method of p 4. (Firefox) Use table-layout: fixed; to force the width of the table, use word-break: break-all, or word-wrap: break-word to form a new line, use overflow: hidden; hide the content that exceeds the limit. overflow: auto; does not work <table style = "table-layout: fixed "width =" 200 "> <tr> <td width =" 25% "style =" word-break: break-all; overflow: hidden; "> abcdefghigklmnopqrstuvwxyz1234567890 </td> <td width =" 75% "style =" word-wra P: break-word; overflow: hidden; "> abcdefghigklmnopqrstuvwxyz1234567890 </td> </tr> </table>: more than 5 items are hidden. (Firefox browser) nest div and p in td and th to run the code box using the methods mentioned above to deal with Firefox. Finally, the probability of such a phenomenon is very small.

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.