Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

torndownunit

macrumors regular
Original poster
Jan 4, 2009
242
0
I am having problems with the correct wording to do a Google search for this, so I am hoping someone here can help me.

I have a small div 'box' for text. Is it possible to have that box automatically resize to a certain point, but if it gets bigger than that have it change to a scrolling box?

I can make a box that auto sizes to the content, or a fixed box that scrolls. I don't know how to combine to the 2, or if I can.

Thanks a lot.
 
You're looking for max-width and max-height. Don't set specific dimensions, or do it using percentages, then set a max-width or max-height (or both, and probably also min-width and min-height), and the box will not grow beyond that size. Then apply your overflow properties, and you're in good shape!

jW
 
A note about the above advice is that IE6 doesn't understand the min-/max- width/height properties.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.