IE Direct use:
Word-break:break-all; /* Allow the word to change the line * *
Word-wrap:break-word; /* content will be wrapped within the boundaries of the line * *
/* The default to note is: * *
Word-wrap:normal/* Allows content to be opened at specified window boundaries * *
And Firefox is not a good way to achieve, a compromise is the use of the scroll bar, but also put forward a network of JS to determine the way to change the line, here excerpts (from the network, hereby indicate). JavaScript Copy Code
<script type= "Text/javascript" >
function Tobreakword (Intlen, id) {
var Obj=document.getelementbyid (ID);
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;
}
</script>
Note: The above script is placed in front of
The same page is called at a single place:
<div id= "Content" > here is to apply the content of the newline </div><script type= "JavaScript" >tobreakword ("content"); </ Script>
Multiple calls on the same page:
<div id= "Content" > here is to apply the content of the newline </div><script type= "JavaScript" >tobreakword ("content"); </ Script>
<div id= "Content2" > here is to apply the content of the newline </div><script type= "JavaScript" >tobreakword ("Content2"); </ Script>
Note: The application of JS written in </div>, where 60 represents a line to display how many characters, pay attention to the corresponding changes in the ID of multiple calls, can not be the same ID name, the above method after IE will also be the number of characters to change lines, but IE inside the support of automatic line wrapping, So as long as the judge is ie, if not IE do not output the above xml/html copy code
<script language= "JavaScript" >tobreakword ("content");</script>
This section of JS, if not the output. Code untested, I only read the train of thought, there is a need to debug it! Leave a message for me with a mistake.
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