Greg Hauptmann wrote: > Hi, > > 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) and > (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. Users > can create their own comments, but you only want them to be able to take up > 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 up? 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 to > the extra content the user put forward, and/or > (2) Do I need to also complete this by programming what content comes out? > E.g. in Ruby on Rails say then the question would be how to calculate how > much text/content can fit in the current size of the DIV (noting browser > re-sizing) so that you get the chance to put the "...more" link at the > bottom? Hopefully this approach isn't required. > > 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 where > each piece of feedback has a maximum area it can take on the main screen > only, and also that browser re-sizing is possible.
I'm not sure if you can add a "more" link dynamically with CSS. That's usually the job of the CMS which I'm assuming you're using since you say the content is dynamic. In any case you can put a height on the div with overflow: hidden then when the "more" link is clicked the CSS changes to overflow: visible or something similar. I saw something similar on this site a while back. I'd be surprised if you can't find it there: http://www.cssplay.co.uk/menu/index.html AC > > Tks > Greg > ______________________________________________________________________ > css-discuss [EMAIL PROTECTED] > http://www.css-discuss.org/mailman/listinfo/css-d > IE7 information -- http://css-discuss.incutio.com/?page=IE7 > List wiki/FAQ -- http://css-discuss.incutio.com/ > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ -- Audra Coldiron Rock-n-Roll Design & Hosting http://rock-n-roll-design.com KarmaCMS ( http://karmawizard.com ) - the ultimate CSS styled CMS. Pre-made designs, designer tools, and reseller program available! ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
