# Folding Text in div Box

**URL:** <https://www.ruby-forum.com/t/folding-text-in-div-box/133149>\
**Category:** Rails\
**Created:** [March 28, 2008, 10:40am UTC](https://www.ruby-forum.com/t/folding-text-in-div-box/133149 "2008-03-28T10:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![namealreadytaken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/97f17d/32.png) [@namealreadytaken](https://www.ruby-forum.com/u/namealreadytaken)\
**Post date:** [March 28, 2008, 10:40am UTC](https://www.ruby-forum.com/t/folding-text-in-div-box/133149/1 "2008-03-28T10:40:53Z")

</div>

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  
screen.

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 [script.aculo.us](http://script.aculo.us) libraries and haven’t seen anything.  
What am I missing?

F

---

<div class="post-metadata">

**Author:** ![namealreadytaken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/97f17d/32.png) [@namealreadytaken](https://www.ruby-forum.com/u/namealreadytaken)\
**Post date:** [March 28, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/folding-text-in-div-box/133149/2 "2008-03-28T14:39:22Z")

</div>

Oops. The ‘

```
’ was overriding the max-width. I was using both.

F
```
