Forum: Ruby on Rails how to dynamically constrain amount of Text/Content in a DIV

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D5df9fcd7ef4c3c937435d7d6adeab2a?d=identicon&s=25 Greg Hauptmann (Guest)
on 2007-05-30 05:33
(Received via mailing list)

Can anyone recommend how best to how to dynamically constrain amount of
Text/Content in a DIV area that can vary in size??

That is, say you have:
(a) a content (DIV) area on your view that can expand/contract depending
upon browser size (i.e. when someone is re-sizing the browser window)
(b) dynamic text/content that is to be displayed, based upon user input
e.g. image a defined area/size for several user comments for example.
can create their own comments, but you only want them to be able to take
a given amount of screen resource, and then perhaps have a "...more"
link at
the bottom if they go over.

How can I best setup this in Rails?  e.g.
(1) How to setup the layout/CSS so that if more text / content is
present in
the DIV area that can be displayed that the DIV area doesn't expand due
the extra content the user put forward, and/or
(2) How to calculate how much text/content can fit in the current size
the DIV (noting browser re-sizing) so that you get the chance to put the
"...more" link at the bottom?

Any other suggestions welcome that address what I'm trying to do are
welcome, which is really offering a area for display of user feedback
each piece of feedback has a maximum area it can take on the main screen
only, and also that browser re-sizing is possible.

This topic is locked and can not be replied to.