// http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_word-wrap
<!DOCTYPE html>
<html>
<head>
<style>
p.test {
width: 10em;
border: 1px solid #000000;
word-wrap: break-word;
}
</style>
</head>
<body>
<p class="test"> This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p>
</body>
</html>
This paragraph contains
a very long word:
thisisaveryveryveryvery
veryverylongword. The
long word will break
and wrap to the next
line.
Edit after doing some more playing around, it looks like word-break: break-all is more appropriate than word-wrap: break-word
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<!DOCTYPE html>
<html>
<head>
<style>
p.test {
width: 14em;
word-break: break-all
}
</style>
</head>
<body>
<p class="test">Jack Sprat could eat no fat. His wife could eat no lean. And so betwixt them both, you see, they licked the platter clean.</p>
</body>
</html>
Jack Sprat could eat no fat. His wi
fe could eat no lean. And so betwi
xt them both, you see, they licked
the platter clean.