I have created an editable div box by using the following code.
<DIV id="textdiv" onClick="this.contentEditable='true';">
<PRE>this is the content</PRE>
</DIV>
and the following is the css for it
#textdiv {
position:absolute;
top:30px;
width:600px;
height:670px;
overflow:auto;
background:#DCDCDE;
}
Now when i start entering data into the div, I want it to automatically go to the newline when the data has reached the width size. Now if i keep on entering some characters, the data just keeps on getting added to the right and adds a scroll bar to the div.
Thanks!
Saj
Adding a newline automatically to a div
Moderator: General Moderators
Re: Adding a newline automatically to a div
this isn't really php so i think this is the wrong forum to ask this question.
also i don't know the solution.
also i don't know the solution.
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: Adding a newline automatically to a div
Code: Select all
#textdiv {
position:absolute;
top:30px;
width:600px;
height:670px;
overflow:auto;
background:#DCDCDE;
word-wrap: break-word;
}