Folding Text in div Box

I'm ajaxing some user-entered text back to a div box, with a border
and background, so it's clear where the box is. The long lines in the
text go out beyond the right borders of the box, and even off the

I can write code to fold long lines, in Ruby or Javascript, but I'm
sure this has already been done. You'd think there was a CSS trick
for this but I haven't come across it yet. I'm all code but weak on
the CSS/presentation side.

So what's the standard Rails solution for this? I've looked in the
prototype and libraries and haven't seen anything.
What am I missing?


Oops. The '<pre>' was overriding the max-width. I was using both.