James Hague wrote: > On 5/18/07, *Brian Crescimanno* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > The required effect is to get the outer 'main frame' div - with its > gray border - to enclose the inner 'regContainer' div, irrespetive of > 'regContainer' height. > > but you can either remove > > the height property on your mainFrame (and thus allow it to > expand to > > fit the content) but making your page scroll (which is normally > accepted > > behaviour). > > > but when I remove the height : 100% - the frame actually shrinks in > both IE6 + FF - and it doesnt really solve the problem. [snip]
This is becasue without the height 100% attribute, the div is being sized according to the content inside of it. Use a lorem ipsum generator to generate some longer content and you'll see that it does indeed stretch with the content. It sounds like you want the viewport to be the size of the page at all times, however so what you should do is stated below in my next comment. [/snip] > > The point is that the height of the regContainer is unknown - so I am > not sure how to set it in that case. [snip] Use percentages and max-height. This will mean the div will only take up what space its content needs up the the maximum height of 1/2 of the viewport (and, thus, your .mainFrame). Now, max-height won't be respected by IE6 and lower but if you set the min-height property (and us an ie hack) then the end result will be that ie users will see scrollbars if the .regContainer causes .mainFrame to expand. What it sounds like you're trying to accomplish is to keep your page within the viewport at all times no matter what size the window is. This, however, is a poor layout choice for a few reasons: a) It is not very well support(ed/able) by browsers b) You can't resize text with the window size (well, not without using javascript and not EVERYONE has javascript enabled) c) When content starts overflowing its containers (and it will, I assure you) your page will be cluttered by many different scrollbars which just aren't pretty or (worse still) will be hidden and creating a HUGE accessibility issue. That being said, it's *possible* to achieve the effect you desire by using the above tips as well as those provided by others on the list, I would just be prepared to hear negative feedback from your end users and have another layout idea simmering in the back of your mind. -- Thanks, Jim ______________________________________________________________________ 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/
