Copy Code code as follows:
Irefox in continuous English characters if you want to CSS control forced line, explore the N for a long time, found to be unable to achieve the forced when the use of JS script to control it
The English character wraps automatically, truncates the string through the JS script, this method general Ie6,ie7,firefox compatible solution
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>js to implement continuous English character wrapping </title>
<body>
<div id= "ff" style= "Width:500px;background: #f3f3f3;" >sssssssssssssssss
Sssssssssssssssssssssssssssssssssssssssssssssssss</div>
<script>
function Tobreakword (Intlen) {
var Obj=document.getelementbyid ("FF");/ID of the container where the text content resides
var strcontent=obj.innerhtml;
var strtemp= "";
while (Strcontent.length>intlen) {
Strtemp+=strcontent.substr (0,intlen) + "<br/>";
Strcontent=strcontent.substr (intlen,strcontent.length);
}
Strtemp+=strcontent;
Obj.innerhtml=strtemp;
}
Tobreakword (50);//The maximum number of characters in a line
</script>
</body>