JS forced line wrap support Firefox [Firefox] browser

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags ajax browser content document firefox forced html http

<!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<html xmlns=" http://www.jzread.com/1999/xhtml ">
<head>
< Meta http-equiv= "Content-type" content= "HTML; Charset=utf-8 "/>
<title>firefox-break-word</title>
<style type=" Text/css ">
<!- -/*--><! [cdata[/*><!--*/
#break {border:1px solid #ccc;p adding:.4em. 8em;width:200px;word-wrap:break-word; Word-break:break-all;
/*] >*/-->
</style>
</head>
<body>
<div id= "Break" >
if there were pager Sympathy in the world, there would is pager trouble in the world. (O. Wilde)
</div>
<script>
Function Tobreakword (intlen) {
var Obj=document.getelementbyid ( "FF");
Var strcontent=obj.innerhtml;
var strtemp= "";
while (Strcontent.length>intlen) {
Strtemp+=strcontent.substr (0,intlen) +
";
Strcontent=strcontent.substr (intlen,strcontent.length);
}
strtemp+= "
" +strcontent;
Obj.innerhtml=strtemp;
}
if (document.getElementById &&!document.all) Tobreakword (Notoginseng)
</script>
1. (ie browser) consecutive English characters and Arabic numerals, using Word-wrap:break-word or Word-break:break-all;

#wrap {word-break:break-all; width:200px;}
Or
#wrap {word-wrap:break-word; width:200px;}

<div id= "Wrap" >abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

Effect: You can implement line wrapping

2. (Firefox browser) consecutive English characters and Arabic numerals break, all versions of Firefox did not solve this problem, we have to let go beyond the bounds of the characters hidden or, add a scroll bar to the container


#wrap {word-break:break-all; width:200px; overflow:auto;}

<div id= "Wrap" >abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>

Effect: Container normal, content hidden

</body>
</html>

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.