Page 1 of 1

CSS Blank :( Make parent DIV stretch in height

Posted: Tue Jul 19, 2005 6:01 am
by Chris Corbyn
I'm know I've done this plenty before and it's something that's completely dumb to have stumbled on but what am I missing to make the little DIV blocks cause the outer div to stretch to full height?

This is a simplified, brightened up snip to make it clear what I mean (that grey div hiding away in the background should be stretched with the colored ones.

Code: Select all

<div id=&quote;content&quote; style=&quote;width: auto; padding: 8px; background-color: #CCCCCC&quote;>
	<div style=&quote;height: 100px; width: 35%; position: relative; float: left; background-color: yellow&quote;></div>
	<div style=&quote;height: 100px; width: 65%; position: relative; float: right; background-color: orange&quote;></div>
</div>
Image

It's gonna be a long day :P

Posted: Tue Jul 19, 2005 7:58 am
by Chris Corbyn
Doh! I hadn't made the parent DIV a floater :oops:

[SOLVED]

Posted: Tue Jul 19, 2005 8:53 am
by djot
So why don't you post the updated code?

Posted: Tue Jul 19, 2005 9:03 am
by Chris Corbyn
Hmm... sorry I had thought I explained :P I'll make it clearer ;)

Code: Select all

<div id=&quote;content&quote; style=&quote;width: auto; padding: 8px; background-color: #CCCCCC; position: relative; float: left&quote;>
	<div style=&quote;height: 100px; width: 35%; position: relative; float: left; background-color: yellow&quote;></div>
	<div style=&quote;height: 100px; width: 65%; position: relative; float: right; background-color: orange&quote;></div>
</div>