Csak Zoli
Csak Zoli

Reputation: 428

Characters overflowing container

This is the problem

So basically this is my problem i have a div that gets its value from a <textarea> just like here on Stack Overflow but if I make it into big characters or small the characters won't break to a new line -- they go outside of the <div>. is there a easy and good way to resolve this?

Upvotes: 2

Views: 72

Answers (2)

Steven
Steven

Reputation: 18004

You can use word-wrap.

Example: http://jsfiddle.net/7vDbp/

Usage notes: http://caniuse.com/#search=word-wrap

Alternately, you can insert the <wbr/> tag into your markup at desired word breaks.

Example: http://jsfiddle.net/Wz8jp/

Upvotes: 2

bfavaretto
bfavaretto

Reputation: 71908

Use the following CSS on your element:

word-wrap: break-word;

Upvotes: 7

Related Questions