Reputation: 520
I'm made a div editable using:
<div style="width:100px;" contenteditable="true"></div>
now, i'm putting the content of the div into my db and im extracting it into another page, into a smaller div:
<div style="width:80px;"></div>
if im using the "enter" key while typing - the text breaks lines just fine on the output,
but if im simply writing a long text in the output it leaves the 80px div border.
how can i make the contenteditable div recognize line breaks by its width?
Upvotes: 0
Views: 259
Reputation: 7359
try with:
<div style="max-width:80px; word-wrap:break-word;"></div>
Upvotes: 3