Iulian Miu
Iulian Miu

Reputation: 218

How can I wrap long lines without spaces in contenteditable

Hy, I've tried everything and nothing works.

I have this fiddle: http://jsfiddle.net/kauqdk9j/

<div id="test" contenteditable="true"></div>

#test { width:400px; height:30px; font-size:13px; border:1px solid #333; word-wrap:break-word; word-break: break-all;white-space: nowrap}

I've tried in CSS: word-wrap:break-word; word-break: break-all;white-space: nowrap, and nothing happens. Can someone help me with this issue please?

Upvotes: 7

Views: 6107

Answers (1)

alessandrio
alessandrio

Reputation: 4370

wrap

#test {
    width:400px;
    height:30px;
    font-size:13px;
    border:1px solid #333;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

nowrap

#test {
    width:400px;
    height:30px;
    font-size:13px;
    border:1px solid #333;

    word-wrap: normal;
    overflow-wrap: normal;
    white-space: nowrap;
}

Upvotes: 13

Related Questions