PDA

View Full Version : Forcing a main div to stretch to the content size


bradyj
05-18-2004, 05:24 AM
I cannot seem to get this main div to stretch to the content of my little images:
http://www.dotfive.com/faux/

Any ideas why? Is it the absolute positioned div? What can I do as a work around... other than making the div height: 150%; or so...

Side issue, does the alpha png work for you IE PC guys? Such as suggested here:
http://www.codingforums.com/showthread.php?t=37991&page=1&pp=10

mindlessLemming
05-18-2004, 05:56 AM
Weird, neither can I :(
Even without any absolute positioning it still doesn't play friendly...
Personally I'd probably float the column right and put a clearing div in the bottom of the main div.
<div style="clear:right; height:1px; margin-bottom:-1px;">&nbsp;</div>
But that's a pretty nasty workaround and shouldn't be necessarry :confused:

P.S. - Bad news: .png's aren't working in IE6. :eek:

bradyj
05-18-2004, 06:25 AM
png's working now? I need my testing pc back:(

Yeah, I have no idea why that doesn't work, it's putting me in a bad mood. Any other ideas?

I don't want to have to force that page to 120% or something -- I tried 'auto' as a height, and that actually came up shorter than those list items are in there. Weird.

mindlessLemming
05-18-2004, 07:54 AM
Still no luck on the png front, I'm afraid.
You can also use Dan Vine's ieCapture for checking that while you don't have a pc.
I can't think of any reason why that column is behaving like it is...
just when you think you've got half a clue about this css nonsense...

me'
05-18-2004, 03:04 PM
You've set 'height: 100%' on the main div, which makes it stretch 100% of the viewport, and never any more. If the content stretches over the height of one viewport's worth, it will overflow. Try this instead:div.main { height: 100%; voice-family: "\"}/*\""; height: auto; min-height: 100% }
/* */The hack's there for IE: it recognises height as min-height, but doesn't recognise min-height itself.

bradyj
05-18-2004, 04:59 PM
Still didn't work for the main container -- I would've thought a simple auto height would have done it... oh well, I think I'm stuck with doing a 120% or more instead of the hack.

As for the png, I think I'm stuck with a list apart's javascript hack or I am going to serve up a new site for IE users without the shadows. This one really pisses me off -- why no PNG's!! Why!!!

me'
05-18-2004, 05:04 PM
why no PNG's!! Why!!!Well, actually IE supports the PNG format, just not 24-bit transparency on said images.

bradyj
05-18-2004, 05:29 PM
Well, actually IE supports the PNG format, just not 24-bit transparency on said images.

Yeah, that's what I meant... what a beautiful feature to lack -- I don't understand why -- Acrobat, InDesign, Illustrator, Photoshop, postscript technology -- all the printing apps and coding supports it... I would have thought the monitors would have come first, it's easier to impliment.

bradyj
05-25-2004, 05:29 AM
Alright, revisiting the main issue -- I have no idea why I cannot get my two nested divs to stretch the full height of their content:
http://www.fauxfilled.com

Why does the shadow div and the nested main div not stretch to the height of the div to the right with the listed images? AAHAHA! :confused:

spenoir
05-26-2004, 11:41 AM
Try using position: relative;

:)

bradyj
05-26-2004, 04:36 PM
Try using position: relative;

:)

Hmmm, can I center those div's then? I have two nested divs, one shadow and one the main content... Thanks for all your guys' help :D