Reputation: 7049
I have a div with paragraphs. I'd like to set a max-width. It works, the problem is that long words don't wrap...
Example: http://jsfiddle.net/multiformeingegno/s8qE3/
<div style="max-width:100px">
<p>Something Something! BASTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!<br/>
Upvotes: 1
Views: 541
Reputation: 312
You can apply the following CSS code:
p {
word-wrap:break-word
}
This will cause your paragraphs to wrap on words.
Upvotes: 3
Reputation: 3657
Add word-wrap
to your CSS:
p{ word-wrap: break-word; }
http://jsfiddle.net/fmpeyton/bH2Ne/
Upvotes: 2